home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 June: Reference Library / Dev.CD Jun 95 / Dev.CD Jun 95.toast / Technical Documentation / Mac Tech Notes (DocViewer) / FL • Files / FL16 File MgrPerf.&Caching < prev    next >
MacBinary  |  1995-04-21  |  84.6 KB  |  [ONLN/HLX2]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
1% dexvert MacBinary (archive/macBinary) fallback Supported
100% file MacBinary II, inited, Thu Apr 20 10:48:55 1995, modified Fri Apr 21 02:57:17 1995, creator 'HLX2', type 'ONLN', 82889 bytes "FL16 File MgrPerf.&Caching" , at 0x14449 3563 bytes resource default (weak)
99% file data default
100% TrID MacBinary 2 default (weak)
100% dearkID deark: macbinary default
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[ONLN]
macFileCreator[HLX2]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 1a 46 4c 31 36 20 46 | 69 6c 65 20 4d 67 72 50 |..FL16 F|ile MgrP|
|00000010| 65 72 66 2e 26 43 61 63 | 68 69 6e 67 00 00 00 00 |erf.&Cac|hing....|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 4f 4e 4c 4e 48 4c 58 | 32 01 00 00 00 00 00 00 |.ONLNHLX|2.......|
|00000050| 00 00 00 00 01 43 c9 00 | 00 0d eb ab bc 24 d7 ab |.....C..|.....$..|
|00000060| bd 07 cd 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 bb f0 00 00 |........|........|
|00000080| 46 4c 20 31 36 20 2d 20 | 46 69 6c 65 20 4d 61 6e |FL 16 - |File Man|
|00000090| 61 67 65 72 20 50 65 72 | 66 6f 72 6d 61 6e 63 65 |ager Per|formance|
|000000a0| 20 61 6e 64 20 43 61 63 | 68 69 6e 67 0d 46 69 6c | and Cac|hing.Fil|
|000000b0| 65 73 0d 52 65 76 69 73 | 65 64 20 62 79 3a 09 4a |es.Revis|ed by:.J|
|000000c0| 69 6d 20 4c 75 74 68 65 | 72 09 41 70 72 69 6c 20 |im Luthe|r.April |
|000000d0| 31 39 39 35 0d 4f 72 69 | 67 69 6e 61 6c 20 62 79 |1995.Ori|ginal by|
|000000e0| 3a 09 52 69 63 6b 20 42 | 6c 61 69 72 09 4a 75 6e |:.Rick B|lair.Jun|
|000000f0| 65 20 31 39 38 36 0d 54 | 68 69 73 20 54 65 63 68 |e 1986.T|his Tech|
|00000100| 6e 69 63 61 6c 20 4e 6f | 74 65 20 64 69 73 63 75 |nical No|te discu|
|00000110| 73 73 65 73 20 74 68 65 | 20 53 79 73 74 65 6d 20 |sses the| System |
|00000120| 37 20 46 69 6c 65 20 53 | 79 73 74 65 6d 20 69 6e |7 File S|ystem in|
|00000130| 70 75 74 2f 6f 75 74 70 | 75 74 20 70 65 72 66 6f |put/outp|ut perfo|
|00000140| 72 6d 61 6e 63 65 20 69 | 73 73 75 65 73 20 61 6e |rmance i|ssues an|
|00000150| 64 20 74 68 65 20 46 69 | 6c 65 20 4d 61 6e 61 67 |d the Fi|le Manag|
|00000160| 65 72 d5 73 20 76 6f 6c | 75 6d 65 20 63 61 63 68 |er.s vol|ume cach|
|00000170| 65 2e 20 49 74 20 69 73 | 20 61 73 73 75 6d 65 64 |e. It is| assumed|
|00000180| 20 74 68 65 20 72 65 61 | 64 65 72 20 6f 66 20 74 | the rea|der of t|
|00000190| 68 69 73 20 4e 6f 74 65 | 20 68 61 73 20 61 20 67 |his Note| has a g|
|000001a0| 6f 6f 64 20 75 6e 64 65 | 72 73 74 61 6e 64 69 6e |ood unde|rstandin|
|000001b0| 67 20 6f 66 20 62 61 73 | 69 63 20 46 69 6c 65 20 |g of bas|ic File |
|000001c0| 4d 61 6e 61 67 65 72 20 | 49 2f 4f 20 72 6f 75 74 |Manager |I/O rout|
|000001d0| 69 6e 65 73 2e 0d 43 68 | 61 6e 67 65 73 20 73 69 |ines..Ch|anges si|
|000001e0| 6e 63 65 20 4d 61 72 63 | 68 20 31 39 38 38 3a 20 |nce Marc|h 1988: |
|000001f0| 20 54 68 65 20 4e 6f 74 | 65 20 68 61 73 20 62 65 | The Not|e has be|
|00000200| 65 6e 20 63 6f 6d 70 6c | 65 74 65 6c 79 20 72 65 |en compl|etely re|
|00000210| 77 72 69 74 74 65 6e 2e | 0d 54 6f 70 69 63 73 0d |written.|.Topics.|
|00000220| a5 09 53 69 7a 65 20 6f | 66 20 79 6f 75 72 20 49 |..Size o|f your I|
|00000230| 2f 4f 20 72 65 71 75 65 | 73 74 73 0d a5 09 41 6c |/O reque|sts...Al|
|00000240| 69 67 6e 6d 65 6e 74 20 | 6f 66 20 79 6f 75 72 20 |ignment |of your |
|00000250| 49 2f 4f 20 72 65 71 75 | 65 73 74 73 0d a5 09 43 |I/O requ|ests...C|
|00000260| 6f 6e 74 72 6f 6c 6c 69 | 6e 67 20 74 68 65 20 46 |ontrolli|ng the F|
|00000270| 69 6c 65 20 4d 61 6e 61 | 67 65 72 d5 73 20 63 61 |ile Mana|ger.s ca|
|00000280| 63 68 65 0d a5 09 42 61 | 6c 61 6e 63 69 6e 67 20 |che...Ba|lancing |
|00000290| 43 61 63 68 65 64 20 49 | 2f 4f 20 50 65 72 66 6f |Cached I|/O Perfo|
|000002a0| 72 6d 61 6e 63 65 20 61 | 6e 64 20 44 61 74 61 20 |rmance a|nd Data |
|000002b0| 49 6e 74 65 67 72 69 74 | 79 0d 54 68 65 20 4d 61 |Integrit|y.The Ma|
|000002c0| 63 69 6e 74 6f 73 68 20 | 46 69 6c 65 20 4d 61 6e |cintosh |File Man|
|000002d0| 61 67 65 72 d5 73 20 69 | 6e 70 75 74 2f 6f 75 74 |ager.s i|nput/out|
|000002e0| 70 75 74 20 70 72 6f 67 | 72 61 6d 6d 69 6e 67 20 |put prog|ramming |
|000002f0| 69 6e 74 65 72 66 61 63 | 65 20 68 61 73 6e d5 74 |interfac|e hasn.t|
|00000300| 20 63 68 61 6e 67 65 64 | 20 6d 75 63 68 20 73 69 | changed| much si|
|00000310| 6e 63 65 20 31 39 38 34 | 2e 20 54 68 65 72 65 20 |nce 1984|. There |
|00000320| 61 72 65 20 61 20 68 61 | 6c 66 20 64 6f 7a 65 6e |are a ha|lf dozen|
|00000330| 20 6e 65 77 20 77 61 79 | 73 20 74 6f 20 6f 70 65 | new way|s to ope|
|00000340| 6e 20 61 20 66 69 6c 65 | 2c 20 62 75 74 20 77 68 |n a file|, but wh|
|00000350| 65 6e 20 69 74 20 67 65 | 74 73 20 64 6f 77 6e 20 |en it ge|ts down |
|00000360| 74 6f 20 61 63 63 65 73 | 73 69 6e 67 20 74 68 65 |to acces|sing the|
|00000370| 20 64 61 74 61 20 69 6e | 20 61 20 66 69 6c 65 2c | data in| a file,|
|00000380| 20 79 6f 75 20 73 74 69 | 6c 6c 20 65 6e 64 20 75 | you sti|ll end u|
|00000390| 70 20 75 73 69 6e 67 20 | 74 68 65 20 73 61 6d 65 |p using |the same|
|000003a0| 20 72 65 61 64 20 61 6e | 64 20 77 72 69 74 65 20 | read an|d write |
|000003b0| 63 61 6c 6c 73 20 74 68 | 65 20 4d 61 63 69 6e 74 |calls th|e Macint|
|000003c0| 6f 73 68 20 73 74 61 72 | 74 65 64 20 77 69 74 68 |osh star|ted with|
|000003d0| 2e 20 53 69 6e 63 65 20 | 6c 69 74 74 6c 65 20 68 |. Since |little h|
|000003e0| 61 73 20 63 68 61 6e 67 | 65 64 2c 20 6d 6f 73 74 |as chang|ed, most|
|000003f0| 20 4d 61 63 69 6e 74 6f | 73 68 20 70 72 6f 67 72 | Macinto|sh progr|
|00000400| 61 6d 6d 65 72 73 20 70 | 61 79 20 6c 69 74 74 6c |ammers p|ay littl|
|00000410| 65 20 6f 72 20 6e 6f 20 | 61 74 74 65 6e 74 69 6f |e or no |attentio|
|00000420| 6e 20 74 6f 20 68 6f 77 | 20 74 68 65 69 72 20 70 |n to how| their p|
|00000430| 72 6f 67 72 61 6d 73 20 | 61 63 63 65 73 73 20 66 |rograms |access f|
|00000440| 69 6c 65 73 20 75 6e 74 | 69 6c 20 74 68 65 79 20 |iles unt|il they |
|00000450| 66 69 6e 64 20 74 68 65 | 20 6f 76 65 72 61 6c 6c |find the| overall|
|00000460| 20 70 65 72 66 6f 72 6d | 61 6e 63 65 20 6f 66 20 | perform|ance of |
|00000470| 74 68 65 69 72 20 70 72 | 6f 67 72 61 6d 20 64 65 |their pr|ogram de|
|00000480| 70 65 6e 64 73 20 6f 6e | 20 66 69 6c 65 20 61 63 |pends on| file ac|
|00000490| 63 65 73 73 20 73 70 65 | 65 64 2e 20 54 68 69 73 |cess spe|ed. This|
|000004a0| 20 4e 6f 74 65 20 73 68 | 6f 77 73 20 79 6f 75 20 | Note sh|ows you |
|000004b0| 68 6f 77 20 74 6f 20 67 | 65 74 20 74 68 65 20 62 |how to g|et the b|
|000004c0| 65 73 74 20 74 68 72 6f | 75 67 68 70 75 74 20 66 |est thro|ughput f|
|000004d0| 72 6f 6d 20 74 68 65 20 | 4d 61 63 69 6e 74 6f 73 |rom the |Macintos|
|000004e0| 68 20 66 69 6c 65 20 73 | 79 73 74 65 6d 20 75 73 |h file s|ystem us|
|000004f0| 69 6e 67 20 61 20 76 61 | 72 69 65 74 79 20 6f 66 |ing a va|riety of|
|00000500| 20 74 65 63 68 6e 69 71 | 75 65 73 2e 0d 41 6c 74 | techniq|ues..Alt|
|00000510| 68 6f 75 67 68 20 74 68 | 69 73 20 4e 6f 74 65 d5 |hough th|is Note.|
|00000520| 73 20 70 72 69 6d 61 72 | 79 20 66 6f 63 75 73 20 |s primar|y focus |
|00000530| 69 73 20 6f 6e 20 74 68 | 65 20 48 46 53 20 66 69 |is on th|e HFS fi|
|00000540| 6c 65 20 73 79 73 74 65 | 6d 2c 20 74 68 65 20 74 |le syste|m, the t|
|00000550| 65 63 68 6e 69 71 75 65 | 73 20 64 65 73 63 72 69 |echnique|s descri|
|00000560| 62 65 64 20 77 69 6c 6c | 20 6c 69 6b 65 6c 79 20 |bed will| likely |
|00000570| 69 6d 70 72 6f 76 65 20 | 70 65 72 66 6f 72 6d 61 |improve |performa|
|00000580| 6e 63 65 20 77 68 65 6e | 20 75 73 65 64 20 77 69 |nce when| used wi|
|00000590| 74 68 20 61 6e 79 20 6f | 74 68 65 72 20 66 69 6c |th any o|ther fil|
|000005a0| 65 20 73 79 73 74 65 6d | 20 6f 6e 20 74 68 65 20 |e system| on the |
|000005b0| 4d 61 63 69 6e 74 6f 73 | 68 2e 0d 4e 6f 74 65 3a |Macintos|h..Note:|
|000005c0| 09 54 68 65 20 69 6e 74 | 65 6e 74 20 6f 66 20 74 |.The int|ent of t|
|000005d0| 68 69 73 20 4e 6f 74 65 | 20 69 73 20 74 6f 20 74 |his Note| is to t|
|000005e0| 65 6c 6c 20 68 6f 77 20 | 74 6f 20 75 73 65 20 74 |ell how |to use t|
|000005f0| 68 65 20 46 69 6c 65 20 | 4d 61 6e 61 67 65 72 20 |he File |Manager |
|00000600| 41 50 49 20 74 6f 20 69 | 6d 70 72 6f 76 65 20 74 |API to i|mprove t|
|00000610| 68 65 20 70 65 72 66 6f | 72 6d 61 6e 63 65 20 6f |he perfo|rmance o|
|00000620| 66 20 66 69 6c 65 20 49 | 2f 4f 2c 20 6e 6f 74 20 |f file I|/O, not |
|00000630| 74 6f 20 64 65 73 63 72 | 69 62 65 20 69 6e 20 64 |to descr|ibe in d|
|00000640| 65 74 61 69 6c 20 74 68 | 65 20 70 72 6f 63 65 73 |etail th|e proces|
|00000650| 73 65 73 20 61 6e 64 20 | 73 74 65 70 73 20 74 61 |ses and |steps ta|
|00000660| 6b 65 6e 20 62 79 20 74 | 68 65 20 4d 61 63 69 6e |ken by t|he Macin|
|00000670| 74 6f 73 68 20 66 69 6c | 65 20 73 79 73 74 65 6d |tosh fil|e system|
|00000680| 20 74 6f 20 70 65 72 66 | 6f 72 6d 20 66 69 6c 65 | to perf|orm file|
|00000690| 20 49 2f 4f 2e 20 54 68 | 75 73 2c 20 74 68 65 20 | I/O. Th|us, the |
|000006a0| 64 65 73 63 72 69 70 74 | 69 6f 6e 73 20 6f 66 20 |descript|ions of |
|000006b0| 74 68 65 20 70 72 6f 63 | 65 73 73 65 73 20 61 6e |the proc|esses an|
|000006c0| 64 20 73 74 65 70 73 20 | 74 61 6b 65 6e 20 62 79 |d steps |taken by|
|000006d0| 20 74 68 65 20 4d 61 63 | 69 6e 74 6f 73 68 20 66 | the Mac|intosh f|
|000006e0| 69 6c 65 20 73 79 73 74 | 65 6d 20 74 6f 20 70 65 |ile syst|em to pe|
|000006f0| 72 66 6f 72 6d 20 66 69 | 6c 65 20 49 2f 4f 20 61 |rform fi|le I/O a|
|00000700| 72 65 20 6d 75 63 68 20 | 73 69 6d 70 6c 65 72 20 |re much |simpler |
|00000710| 74 68 61 6e 20 77 68 61 | 74 20 61 63 74 75 61 6c |than wha|t actual|
|00000720| 6c 79 20 74 61 6b 65 20 | 70 6c 61 63 65 2e 0d 45 |ly take |place..E|
|00000730| 61 63 68 20 74 69 6d 65 | 20 79 6f 75 20 72 65 61 |ach time| you rea|
|00000740| 64 20 6f 72 20 77 72 69 | 74 65 20 64 61 74 61 20 |d or wri|te data |
|00000750| 74 6f 20 61 20 66 69 6c | 65 2c 20 61 20 66 69 6c |to a fil|e, a fil|
|00000760| 65 20 73 79 73 74 65 6d | 20 6d 75 73 74 20 70 65 |e system| must pe|
|00000770| 72 66 6f 72 6d 20 73 65 | 76 65 72 61 6c 20 73 74 |rform se|veral st|
|00000780| 65 70 73 20 77 68 69 63 | 68 20 75 6c 74 69 6d 61 |eps whic|h ultima|
|00000790| 74 65 6c 79 20 65 6e 64 | 20 75 70 20 74 72 61 6e |tely end| up tran|
|000007a0| 73 66 65 72 72 69 6e 67 | 20 64 61 74 61 20 66 72 |sferring| data fr|
|000007b0| 6f 6d 20 79 6f 75 72 20 | 62 75 66 66 65 72 20 74 |om your |buffer t|
|000007c0| 6f 20 74 68 65 20 66 69 | 6c 65 20 6f 72 20 74 6f |o the fi|le or to|
|000007d0| 20 79 6f 75 72 20 62 75 | 66 66 65 72 20 66 72 6f | your bu|ffer fro|
|000007e0| 6d 20 74 68 65 20 66 69 | 6c 65 2e 20 46 6f 72 20 |m the fi|le. For |
|000007f0| 74 68 65 20 70 75 72 70 | 6f 73 65 73 20 6f 66 20 |the purp|oses of |
|00000800| 74 68 69 73 20 6e 6f 74 | 65 2c 20 77 65 d5 6c 6c |this not|e, we.ll|
|00000810| 20 64 69 76 69 64 65 20 | 74 68 61 74 20 74 69 6d | divide |that tim|
|00000820| 65 20 75 70 20 69 6e 74 | 6f 20 74 77 6f 20 63 61 |e up int|o two ca|
|00000830| 74 65 67 6f 72 69 65 73 | 3a 20 64 61 74 61 20 74 |tegories|: data t|
|00000840| 72 61 6e 73 66 65 72 20 | 74 69 6d 65 20 61 6e 64 |ransfer |time and|
|00000850| 20 72 65 71 75 65 73 74 | 20 6f 76 65 72 68 65 61 | request| overhea|
|00000860| 64 20 74 69 6d 65 2e 20 | 54 68 65 20 66 69 72 73 |d time. |The firs|
|00000870| 74 20 73 74 65 70 20 74 | 6f 20 69 6d 70 72 6f 76 |t step t|o improv|
|00000880| 69 6e 67 20 66 69 6c 65 | 20 49 2f 4f 20 70 65 72 |ing file| I/O per|
|00000890| 66 6f 72 6d 61 6e 63 65 | 20 69 73 20 74 6f 20 72 |formance| is to r|
|000008a0| 65 64 75 63 65 20 74 68 | 65 20 61 6d 6f 75 6e 74 |educe th|e amount|
|000008b0| 20 6f 66 20 72 65 71 75 | 65 73 74 20 6f 76 65 72 | of requ|est over|
|000008c0| 68 65 61 64 20 74 69 6d | 65 20 75 73 65 64 20 74 |head tim|e used t|
|000008d0| 6f 20 74 72 61 6e 73 66 | 65 72 20 61 20 67 69 76 |o transf|er a giv|
|000008e0| 65 6e 20 61 6d 6f 75 6e | 74 20 6f 66 20 64 61 74 |en amoun|t of dat|
|000008f0| 61 2e 0d 49 6e 63 72 65 | 61 73 65 20 74 68 65 20 |a..Incre|ase the |
|00000900| 53 69 7a 65 20 6f 66 20 | 49 2f 4f 20 52 65 71 75 |Size of |I/O Requ|
|00000910| 65 73 74 73 0d 54 68 65 | 20 73 69 7a 65 20 6f 66 |ests.The| size of|
|00000920| 20 79 6f 75 72 20 52 65 | 61 64 20 61 6e 64 20 57 | your Re|ad and W|
|00000930| 72 69 74 65 20 72 65 71 | 75 65 73 74 73 20 63 61 |rite req|uests ca|
|00000940| 6e 20 6d 61 6b 65 20 6d | 6f 72 65 20 64 69 66 66 |n make m|ore diff|
|00000950| 65 72 65 6e 63 65 20 74 | 6f 20 66 69 6c 65 20 49 |erence t|o file I|
|00000960| 2f 4f 20 70 65 72 66 6f | 72 6d 61 6e 63 65 20 74 |/O perfo|rmance t|
|00000970| 68 61 6e 20 61 6e 79 74 | 68 69 6e 67 20 65 6c 73 |han anyt|hing els|
|00000980| 65 20 79 6f 75 20 68 61 | 76 65 20 63 6f 6e 74 72 |e you ha|ve contr|
|00000990| 6f 6c 20 6f 66 2e 20 48 | 65 72 65 d5 73 20 77 68 |ol of. H|ere.s wh|
|000009a0| 79 3a 0d a5 20 09 45 61 | 63 68 20 72 65 71 75 65 |y:.. .Ea|ch reque|
|000009b0| 73 74 20 77 69 6c 6c 20 | 69 6e 63 75 72 20 73 6f |st will |incur so|
|000009c0| 6d 65 20 72 65 71 75 65 | 73 74 20 6f 76 65 72 68 |me reque|st overh|
|000009d0| 65 61 64 20 74 69 6d 65 | 2e 0d a5 20 09 45 61 63 |ead time|... .Eac|
|000009e0| 68 20 72 65 71 75 65 73 | 74 20 77 69 6c 6c 20 69 |h reques|t will i|
|000009f0| 6e 76 6f 6c 76 65 20 6f | 6e 65 20 6f 72 20 6d 6f |nvolve o|ne or mo|
|00000a00| 72 65 20 63 61 6c 6c 73 | 20 74 6f 20 61 20 64 69 |re calls| to a di|
|00000a10| 73 6b 20 64 72 69 76 65 | 72 20 74 68 72 6f 75 67 |sk drive|r throug|
|00000a20| 68 20 74 68 65 20 66 69 | 6c 65 20 73 79 73 74 65 |h the fi|le syste|
|00000a30| 6d 20 63 61 63 68 65 20 | 6f 72 20 74 6f 20 61 20 |m cache |or to a |
|00000a40| 6e 65 74 77 6f 72 6b 20 | 64 65 76 69 63 65 20 74 |network |device t|
|00000a50| 68 72 6f 75 67 68 20 61 | 20 6e 65 74 77 6f 72 6b |hrough a| network|
|00000a60| 20 64 72 69 76 65 72 2e | 0d a5 09 45 61 63 68 20 | driver.|...Each |
|00000a70| 72 65 71 75 65 73 74 20 | 6d 61 79 20 63 61 75 73 |request |may caus|
|00000a80| 65 20 6f 6e 65 20 6f 72 | 20 6d 6f 72 65 20 64 61 |e one or| more da|
|00000a90| 74 61 20 74 72 61 6e 73 | 66 65 72 73 20 66 72 6f |ta trans|fers fro|
|00000aa0| 6d 20 74 68 65 20 64 69 | 73 6b 20 64 72 69 76 65 |m the di|sk drive|
|00000ab0| 72 20 61 6e 64 20 74 68 | 65 20 64 69 73 6b 20 64 |r and th|e disk d|
|00000ac0| 65 76 69 63 65 2c 20 6f | 72 20 74 68 65 20 6e 65 |evice, o|r the ne|
|00000ad0| 74 77 6f 72 6b 20 64 72 | 69 76 65 72 20 61 6e 64 |twork dr|iver and|
|00000ae0| 20 6e 65 74 77 6f 72 6b | 20 64 65 76 69 63 65 2e | network| device.|
|00000af0| 20 41 20 64 65 76 69 63 | 65 20 61 63 63 65 73 73 | A devic|e access|
|00000b00| 20 6d 61 79 20 62 65 20 | 76 65 72 79 20 66 61 73 | may be |very fas|
|00000b10| 74 20 28 72 65 61 64 69 | 6e 67 20 64 61 74 61 20 |t (readi|ng data |
|00000b20| 66 72 6f 6d 20 6f 72 20 | 77 72 69 74 69 6e 67 20 |from or |writing |
|00000b30| 64 61 74 61 20 74 6f 20 | 61 20 64 69 73 6b 20 64 |data to |a disk d|
|00000b40| 65 76 69 63 65 d5 73 20 | 6f 72 20 64 69 73 6b 20 |evice.s |or disk |
|00000b50| 64 72 69 76 65 72 d5 73 | 20 63 61 63 68 65 29 2c |driver.s| cache),|
|00000b60| 20 6f 72 20 76 65 72 79 | 20 73 6c 6f 77 20 28 77 | or very| slow (w|
|00000b70| 61 69 74 69 6e 67 20 66 | 6f 72 20 61 20 73 74 6f |aiting f|or a sto|
|00000b80| 70 70 65 64 20 66 6c 6f | 70 70 79 20 64 69 73 6b |pped flo|ppy disk|
|00000b90| 20 64 72 69 76 65 20 74 | 6f 20 63 6f 6d 65 20 75 | drive t|o come u|
|00000ba0| 70 20 74 6f 20 73 70 65 | 65 64 20 61 6e 64 20 74 |p to spe|ed and t|
|00000bb0| 68 65 6e 20 72 65 61 64 | 69 6e 67 20 6f 72 20 77 |hen read|ing or w|
|00000bc0| 72 69 74 69 6e 67 20 74 | 68 65 20 64 61 74 61 29 |riting t|he data)|
|00000bd0| 2e 0d 4c 65 74 d5 73 20 | 6c 6f 6f 6b 20 61 74 20 |..Let.s |look at |
|00000be0| 61 6e 20 65 78 61 6d 70 | 6c 65 3a 20 72 65 61 64 |an examp|le: read|
|00000bf0| 73 20 66 72 6f 6d 20 61 | 20 66 61 73 74 20 28 62 |s from a| fast (b|
|00000c00| 79 20 74 6f 64 61 79 d5 | 73 20 73 74 61 6e 64 61 |y today.|s standa|
|00000c10| 72 64 73 29 20 53 43 53 | 49 20 68 61 72 64 20 64 |rds) SCS|I hard d|
|00000c20| 69 73 6b 20 64 72 69 76 | 65 20 77 69 74 68 20 61 |isk driv|e with a|
|00000c30| 6e 20 61 76 65 72 61 67 | 65 20 61 63 63 65 73 73 |n averag|e access|
|00000c40| 20 74 69 6d 65 20 6f 66 | 20 61 70 70 72 6f 78 69 | time of| approxi|
|00000c50| 6d 61 74 65 6c 79 20 31 | 30 20 6d 69 6c 6c 69 73 |mately 1|0 millis|
|00000c60| 65 63 6f 6e 64 73 20 61 | 6e 64 20 61 20 50 6f 77 |econds a|nd a Pow|
|00000c70| 65 72 20 4d 61 63 69 6e | 74 6f 73 68 20 63 6c 61 |er Macin|tosh cla|
|00000c80| 73 73 20 73 79 73 74 65 | 6d 20 77 69 74 68 20 61 |ss syste|m with a|
|00000c90| 20 53 43 53 49 20 74 72 | 61 6e 73 66 65 72 20 72 | SCSI tr|ansfer r|
|00000ca0| 61 74 65 20 6f 66 20 61 | 70 70 72 6f 78 69 6d 61 |ate of a|pproxima|
|00000cb0| 74 65 6c 79 20 35 20 6d | 65 67 61 62 79 74 65 73 |tely 5 m|egabytes|
|00000cc0| 20 70 65 72 20 73 65 63 | 6f 6e 64 20 6f 72 20 30 | per sec|ond or 0|
|00000cd0| 2e 31 20 6d 69 6c 6c 69 | 73 65 63 6f 6e 64 73 20 |.1 milli|seconds |
|00000ce0| 70 65 72 20 35 31 32 2d | 62 79 74 65 20 64 69 73 |per 512-|byte dis|
|00000cf0| 6b 20 62 6c 6f 63 6b 2e | 20 57 68 65 6e 20 61 20 |k block.| When a |
|00000d00| 73 69 6e 67 6c 65 20 64 | 69 73 6b 20 62 6c 6f 63 |single d|isk bloc|
|00000d10| 6b 20 28 35 31 32 20 62 | 79 74 65 73 29 20 69 73 |k (512 b|ytes) is|
|00000d20| 20 72 65 61 64 2c 20 74 | 68 65 20 74 69 6d 65 20 | read, t|he time |
|00000d30| 73 70 65 6e 74 20 72 65 | 61 64 69 6e 67 20 74 68 |spent re|ading th|
|00000d40| 65 20 62 6c 6f 63 6b 20 | 6c 6f 6f 6b 73 20 6c 69 |e block |looks li|
|00000d50| 6b 65 20 74 68 69 73 3a | 0d 31 20 62 6c 6f 63 6b |ke this:|.1 block|
|00000d60| 20 74 72 61 6e 73 66 65 | 72 20 77 69 74 68 20 31 | transfe|r with 1|
|00000d70| 30 20 6d 73 20 61 76 65 | 72 61 67 65 20 61 63 63 |0 ms ave|rage acc|
|00000d80| 65 73 73 20 74 69 6d 65 | 0d 54 68 65 20 6f 76 65 |ess time|.The ove|
|00000d90| 72 68 65 61 64 20 74 69 | 6d 65 20 6f 6e 20 74 68 |rhead ti|me on th|
|00000da0| 69 73 20 73 69 6e 67 6c | 65 20 62 6c 6f 63 6b 20 |is singl|e block |
|00000db0| 72 65 61 64 20 69 73 20 | 6f 76 65 72 20 39 39 25 |read is |over 99%|
|00000dc0| 20 6f 66 20 74 68 65 20 | 74 6f 74 61 6c 20 74 69 | of the |total ti|
|00000dd0| 6d 65 2c 20 67 69 76 69 | 6e 67 20 79 6f 75 20 61 |me, givi|ng you a|
|00000de0| 20 74 68 72 6f 75 67 68 | 70 75 74 20 6f 66 20 34 | through|put of 4|
|00000df0| 39 2e 35 4b 20 70 65 72 | 20 73 65 63 6f 6e 64 20 |9.5K per| second |
|00000e00| 28 74 68 61 74 d5 73 20 | 61 62 6f 75 74 20 68 61 |(that.s |about ha|
|00000e10| 6c 66 20 74 68 65 20 74 | 72 61 6e 73 66 65 72 20 |lf the t|ransfer |
|00000e20| 72 61 74 65 20 6f 66 20 | 61 20 53 75 70 65 72 44 |rate of |a SuperD|
|00000e30| 72 69 76 65 20 66 6c 6f | 70 70 79 20 64 69 73 6b |rive flo|ppy disk|
|00000e40| 20 64 72 69 76 65 21 29 | 2e 20 48 6f 77 65 76 65 | drive!)|. Howeve|
|00000e50| 72 2c 20 77 68 65 6e 20 | 74 68 65 20 73 69 7a 65 |r, when |the size|
|00000e60| 20 6f 66 20 74 68 65 20 | 72 65 61 64 20 69 73 20 | of the |read is |
|00000e70| 69 6e 63 72 65 61 73 65 | 64 20 74 6f 20 34 35 30 |increase|d to 450|
|00000e80| 4b 2c 20 74 68 65 20 6f | 76 65 72 68 65 61 64 20 |K, the o|verhead |
|00000e90| 74 69 6d 65 20 69 73 20 | 72 65 64 75 63 65 64 20 |time is |reduced |
|00000ea0| 74 6f 20 61 70 70 72 6f | 78 69 6d 61 74 65 6c 79 |to appro|ximately|
|00000eb0| 20 31 30 25 20 6f 66 20 | 74 68 65 20 74 6f 74 61 | 10% of |the tota|
|00000ec0| 6c 20 74 69 6d 65 2e 20 | 54 68 61 74 d5 73 20 62 |l time. |That.s b|
|00000ed0| 65 63 61 75 73 65 20 74 | 68 65 20 6f 76 65 72 68 |ecause t|he overh|
|00000ee0| 65 61 64 20 72 65 6d 61 | 69 6e 73 20 65 73 73 65 |ead rema|ins esse|
|00000ef0| 6e 74 69 61 6c 6c 79 20 | 74 68 65 20 73 61 6d 65 |ntially |the same|
|00000f00| 20 77 68 69 6c 65 20 74 | 68 65 20 74 6f 74 61 6c | while t|he total|
|00000f10| 20 6e 75 6d 62 65 72 20 | 6f 66 20 62 79 74 65 73 | number |of bytes|
|00000f20| 20 74 72 61 6e 73 66 65 | 72 72 65 64 20 69 6e 63 | transfe|rred inc|
|00000f30| 72 65 61 73 65 73 2e 20 | 54 68 69 73 20 63 68 61 |reases. |This cha|
|00000f40| 6e 67 65 20 6d 61 6b 65 | 73 20 74 68 65 20 61 64 |nge make|s the ad|
|00000f50| 6a 75 73 74 65 64 20 74 | 68 72 6f 75 67 68 70 75 |justed t|hroughpu|
|00000f60| 74 20 66 6f 72 20 74 68 | 69 73 20 74 72 61 6e 73 |t for th|is trans|
|00000f70| 66 65 72 20 34 2e 35 20 | 6d 65 67 61 62 79 74 65 |fer 4.5 |megabyte|
|00000f80| 73 20 70 65 72 20 73 65 | 63 6f 6e 64 2e 0d 39 30 |s per se|cond..90|
|00000f90| 30 20 62 6c 6f 63 6b 20 | 74 72 61 6e 73 66 65 72 |0 block |transfer|
|00000fa0| 20 77 69 74 68 20 31 30 | 20 6d 73 20 61 76 65 72 | with 10| ms aver|
|00000fb0| 61 67 65 20 61 63 63 65 | 73 73 20 74 69 6d 65 0d |age acce|ss time.|
|00000fc0| 49 66 20 79 6f 75 20 77 | 65 72 65 20 74 6f 20 6d |If you w|ere to m|
|00000fd0| 61 6b 65 20 61 20 67 72 | 61 70 68 20 63 6f 6d 70 |ake a gr|aph comp|
|00000fe0| 61 72 69 6e 67 20 74 68 | 65 20 73 69 7a 65 20 6f |aring th|e size o|
|00000ff0| 66 20 79 6f 75 72 20 49 | 2f 4f 20 72 65 71 75 65 |f your I|/O reque|
|00001000| 73 74 73 20 74 6f 20 74 | 68 65 20 74 68 72 6f 75 |sts to t|he throu|
|00001010| 67 68 70 75 74 20 6f 66 | 20 74 68 61 74 20 72 65 |ghput of| that re|
|00001020| 71 75 65 73 74 2c 20 79 | 6f 75 d5 64 20 73 65 65 |quest, y|ou.d see|
|00001030| 20 61 20 63 75 72 76 65 | 20 74 68 61 74 20 6c 6f | a curve| that lo|
|00001040| 6f 6b 73 20 73 69 6d 69 | 6c 61 72 20 74 6f 20 74 |oks simi|lar to t|
|00001050| 68 69 73 3a 0d 53 69 7a | 65 20 6f 66 20 74 72 61 |his:.Siz|e of tra|
|00001060| 6e 73 66 65 72 20 76 73 | 2e 20 74 68 72 6f 75 67 |nsfer vs|. throug|
|00001070| 68 70 75 74 20 6f 66 20 | 74 72 61 6e 73 66 65 72 |hput of |transfer|
|00001080| 0d 49 6d 70 6f 72 74 61 | 6e 74 3a 09 42 79 20 69 |.Importa|nt:.By i|
|00001090| 6e 63 72 65 61 73 69 6e | 67 20 74 68 65 20 73 69 |ncreasin|g the si|
|000010a0| 7a 65 20 6f 66 20 79 6f | 75 72 20 49 2f 4f 20 72 |ze of yo|ur I/O r|
|000010b0| 65 71 75 65 73 74 73 2c | 20 79 6f 75 20 70 75 74 |equests,| you put|
|000010c0| 20 79 6f 75 72 20 49 2f | 4f 20 74 68 72 6f 75 67 | your I/|O throug|
|000010d0| 68 70 75 74 20 63 6c 6f | 73 65 72 20 74 6f 20 74 |hput clo|ser to t|
|000010e0| 68 65 20 6d 61 78 69 6d | 75 6d 20 74 68 72 6f 75 |he maxim|um throu|
|000010f0| 67 68 70 75 74 20 74 68 | 65 20 64 69 73 6b 20 64 |ghput th|e disk d|
|00001100| 65 76 69 63 65 20 69 73 | 20 63 61 70 61 62 6c 65 |evice is| capable|
|00001110| 20 6f 66 2e 0d 4f 6e 65 | 20 6c 61 73 74 20 6e 6f | of..One| last no|
|00001120| 74 65 20 6f 6e 20 74 68 | 65 20 73 69 7a 65 20 6f |te on th|e size o|
|00001130| 66 20 49 2f 4f 20 72 65 | 71 75 65 73 74 73 2e 20 |f I/O re|quests. |
|00001140| 49 6e 20 73 6f 6d 65 20 | 63 61 73 65 73 2c 20 79 |In some |cases, y|
|00001150| 6f 75 20 6d 61 79 20 61 | 63 74 75 61 6c 6c 79 20 |ou may a|ctually |
|00001160| 77 61 6e 74 20 74 6f 20 | 6c 69 6d 69 74 20 74 68 |want to |limit th|
|00001170| 65 20 73 69 7a 65 20 6f | 66 20 79 6f 75 72 20 49 |e size o|f your I|
|00001180| 2f 4f 20 72 65 71 75 65 | 73 74 73 2e 20 46 6f 72 |/O reque|sts. For|
|00001190| 20 65 78 61 6d 70 6c 65 | 2c 20 6c 61 72 67 65 20 | example|, large |
|000011a0| 72 65 61 64 73 20 61 6e | 64 20 77 72 69 74 65 73 |reads an|d writes|
|000011b0| 20 74 6f 20 61 20 66 69 | 6c 65 20 6f 76 65 72 20 | to a fi|le over |
|000011c0| 61 20 73 6c 6f 77 20 6e | 65 74 77 6f 72 6b 20 63 |a slow n|etwork c|
|000011d0| 6f 6e 6e 65 63 74 69 6f | 6e 20 6d 61 79 20 6d 61 |onnectio|n may ma|
|000011e0| 6b 65 20 69 74 20 6c 6f | 6f 6b 20 6c 69 6b 65 20 |ke it lo|ok like |
|000011f0| 74 68 65 20 73 79 73 74 | 65 6d 20 68 61 73 20 6c |the syst|em has l|
|00001200| 6f 63 6b 65 64 20 75 70 | 20 74 6f 20 74 68 65 20 |ocked up| to the |
|00001210| 75 73 65 72 73 20 6f 66 | 20 79 6f 75 72 20 70 72 |users of| your pr|
|00001220| 6f 67 72 61 6d 2e 20 53 | 69 6e 63 65 20 74 68 65 |ogram. S|ince the|
|00001230| 20 4d 61 63 69 6e 74 6f | 73 68 20 64 6f 65 73 6e | Macinto|sh doesn|
|00001240| d5 74 20 63 75 72 72 65 | 6e 74 6c 79 20 67 69 76 |.t curre|ntly giv|
|00001250| 65 20 73 70 65 65 64 20 | 72 61 74 69 6e 67 73 20 |e speed |ratings |
|00001260| 6f 66 20 76 6f 6c 75 6d | 65 73 2c 20 79 6f 75 20 |of volum|es, you |
|00001270| 6d 61 79 20 77 61 6e 74 | 20 74 6f 20 6d 61 6b 65 |may want| to make|
|00001280| 20 79 6f 75 72 20 66 69 | 72 73 74 20 72 65 61 64 | your fi|rst read|
|00001290| 20 6f 72 20 77 72 69 74 | 65 20 74 6f 20 61 20 66 | or writ|e to a f|
|000012a0| 69 6c 65 20 73 6d 61 6c | 6c 20 61 6e 64 20 69 6e |ile smal|l and in|
|000012b0| 63 72 65 61 73 65 20 74 | 68 65 20 73 69 7a 65 20 |crease t|he size |
|000012c0| 6f 66 20 73 75 62 73 65 | 71 75 65 6e 74 20 74 72 |of subse|quent tr|
|000012d0| 61 6e 73 61 63 74 69 6f | 6e 73 20 69 66 20 74 68 |ansactio|ns if th|
|000012e0| 65 20 66 69 72 73 74 20 | 74 72 61 6e 73 61 63 74 |e first |transact|
|000012f0| 69 6f 6e 20 64 6f 65 73 | 6e d5 74 20 74 61 6b 65 |ion does|n.t take|
|00001300| 20 6c 6f 6e 67 20 74 6f | 20 63 6f 6d 70 6c 65 74 | long to| complet|
|00001310| 65 2e 0d 42 6c 6f 63 6b | 20 41 6c 69 67 6e 20 49 |e..Block| Align I|
|00001320| 2f 4f 20 52 65 71 75 65 | 73 74 73 0d 41 66 74 65 |/O Reque|sts.Afte|
|00001330| 72 20 69 6e 63 72 65 61 | 73 69 6e 67 20 74 68 65 |r increa|sing the|
|00001340| 20 73 69 7a 65 20 6f 66 | 20 79 6f 75 72 20 49 2f | size of| your I/|
|00001350| 4f 20 72 65 71 75 65 73 | 74 73 2c 20 74 68 65 20 |O reques|ts, the |
|00001360| 6e 65 78 74 20 74 68 69 | 6e 67 20 79 6f 75 20 73 |next thi|ng you s|
|00001370| 68 6f 75 6c 64 20 6c 6f | 6f 6b 20 61 74 20 69 73 |hould lo|ok at is|
|00001380| 20 74 68 65 20 62 6c 6f | 63 6b 20 61 6c 69 67 6e | the blo|ck align|
|00001390| 6d 65 6e 74 20 6f 66 20 | 79 6f 75 72 20 72 65 71 |ment of |your req|
|000013a0| 75 65 73 74 73 2e 0d 57 | 68 65 6e 20 72 65 61 64 |uests..W|hen read|
|000013b0| 69 6e 67 20 66 72 6f 6d | 20 6f 72 20 77 72 69 74 |ing from| or writ|
|000013c0| 69 6e 67 20 74 6f 20 61 | 20 66 69 6c 65 20 6f 6e |ing to a| file on|
|000013d0| 20 66 69 6c 65 20 73 79 | 73 74 65 6d 73 20 74 68 | file sy|stems th|
|000013e0| 61 74 20 75 73 65 20 62 | 6c 6f 63 6b 20 64 65 76 |at use b|lock dev|
|000013f0| 69 63 65 73 2c 20 64 61 | 74 61 20 69 73 20 72 65 |ices, da|ta is re|
|00001400| 61 64 20 6f 72 20 77 72 | 69 74 74 65 6e 20 69 6e |ad or wr|itten in|
|00001410| 20 63 6f 6d 70 6c 65 74 | 65 20 64 69 73 6b 20 62 | complet|e disk b|
|00001420| 6c 6f 63 6b 73 2e 20 57 | 68 65 6e 20 61 20 72 65 |locks. W|hen a re|
|00001430| 61 64 20 6f 72 20 77 72 | 69 74 65 20 62 65 67 69 |ad or wr|ite begi|
|00001440| 6e 73 20 6f 72 20 65 6e | 64 73 20 69 6e 20 74 68 |ns or en|ds in th|
|00001450| 65 20 6d 69 64 64 6c 65 | 20 6f 66 20 61 20 64 69 |e middle| of a di|
|00001460| 73 6b 20 62 6c 6f 63 6b | 2c 20 74 68 65 20 66 69 |sk block|, the fi|
|00001470| 6c 65 20 73 79 73 74 65 | 6d 20 6d 75 73 74 20 72 |le syste|m must r|
|00001480| 65 61 64 20 74 68 61 74 | 20 65 6e 74 69 72 65 20 |ead that| entire |
|00001490| 62 6c 6f 63 6b 20 69 6e | 74 6f 20 61 20 62 75 66 |block in|to a buf|
|000014a0| 66 65 72 20 6f 77 6e 65 | 64 20 62 79 20 74 68 65 |fer owne|d by the|
|000014b0| 20 66 69 6c 65 20 73 79 | 73 74 65 6d 20 28 61 20 | file sy|stem (a |
|000014c0| 63 61 63 68 65 20 62 75 | 66 66 65 72 29 20 61 6e |cache bu|ffer) an|
|000014d0| 64 20 74 68 65 6e 20 6d | 6f 76 65 20 64 61 74 61 |d then m|ove data|
|000014e0| 20 74 6f 20 6f 72 20 66 | 72 6f 6d 20 79 6f 75 72 | to or f|rom your|
|000014f0| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e d5 73 20 49 | applica|tion.s I|
|00001500| 2f 4f 20 62 75 66 66 65 | 72 2e 20 54 68 65 20 77 |/O buffe|r. The w|
|00001510| 6f 72 73 74 20 63 61 73 | 65 20 69 73 20 61 20 77 |orst cas|e is a w|
|00001520| 72 69 74 65 20 74 68 61 | 74 20 64 6f 65 73 6e d5 |rite tha|t doesn.|
|00001530| 74 20 62 65 67 69 6e 20 | 6f 72 20 65 6e 64 20 6f |t begin |or end o|
|00001540| 6e 20 61 20 62 6c 6f 63 | 6b 20 62 6f 75 6e 64 61 |n a bloc|k bounda|
|00001550| 72 79 2c 20 62 75 74 20 | 69 73 20 6c 61 72 67 65 |ry, but |is large|
|00001560| 20 65 6e 6f 75 67 68 20 | 74 6f 20 77 72 69 74 65 | enough |to write|
|00001570| 20 6f 6e 65 20 6f 72 20 | 6d 6f 72 65 20 66 75 6c | one or |more ful|
|00001580| 6c 20 62 6c 6f 63 6b 73 | 2e 0d 46 6f 72 20 65 78 |l blocks|..For ex|
|00001590| 61 6d 70 6c 65 2c 20 68 | 65 72 65 20 61 72 65 20 |ample, h|ere are |
|000015a0| 74 68 65 20 73 74 65 70 | 73 20 74 68 65 20 48 46 |the step|s the HF|
|000015b0| 53 20 66 69 6c 65 20 73 | 79 73 74 65 6d 20 6d 75 |S file s|ystem mu|
|000015c0| 73 74 20 74 61 6b 65 20 | 74 6f 20 77 72 69 74 65 |st take |to write|
|000015d0| 20 32 30 34 38 20 62 79 | 74 65 73 20 73 74 61 72 | 2048 by|tes star|
|000015e0| 74 69 6e 67 20 61 74 20 | 6f 66 66 73 65 74 20 35 |ting at |offset 5|
|000015f0| 30 20 69 6e 20 74 68 65 | 20 66 69 6c 65 3a 0d 31 |0 in the| file:.1|
|00001600| 2e 09 52 65 61 64 20 74 | 68 65 20 66 69 72 73 74 |..Read t|he first|
|00001610| 20 62 6c 6f 63 6b 20 6f | 66 20 74 68 65 20 66 69 | block o|f the fi|
|00001620| 6c 65 20 69 6e 74 6f 20 | 61 20 66 69 6c 65 20 73 |le into |a file s|
|00001630| 79 73 74 65 6d 20 63 61 | 63 68 65 20 62 75 66 66 |ystem ca|che buff|
|00001640| 65 72 2e 0d 32 2e 09 43 | 6f 70 79 20 34 36 32 20 |er..2..C|opy 462 |
|00001650| 62 79 74 65 73 20 66 72 | 6f 6d 20 74 68 65 20 61 |bytes fr|om the a|
|00001660| 70 70 6c 69 63 61 74 69 | 6f 6e d5 73 20 49 2f 4f |pplicati|on.s I/O|
|00001670| 20 62 75 66 66 65 72 20 | 69 6e 74 6f 20 74 68 65 | buffer |into the|
|00001680| 20 63 61 63 68 65 20 62 | 75 66 66 65 72 20 73 74 | cache b|uffer st|
|00001690| 61 72 74 69 6e 67 20 61 | 74 20 6f 66 66 73 65 74 |arting a|t offset|
|000016a0| 20 35 30 2e 0d 33 2e 09 | 57 72 69 74 65 20 74 68 | 50..3..|Write th|
|000016b0| 65 20 63 61 63 68 65 20 | 62 75 66 66 65 72 20 63 |e cache |buffer c|
|000016c0| 6f 6e 74 61 69 6e 69 6e | 67 20 74 68 65 20 66 69 |ontainin|g the fi|
|000016d0| 72 73 74 20 62 6c 6f 63 | 6b 20 6f 66 20 74 68 65 |rst bloc|k of the|
|000016e0| 20 66 69 6c 65 20 62 61 | 63 6b 20 74 6f 20 74 68 | file ba|ck to th|
|000016f0| 65 20 64 69 73 6b 2e 0d | 34 2e 09 57 72 69 74 65 |e disk..|4..Write|
|00001700| 20 31 35 33 36 20 62 79 | 74 65 73 20 66 72 6f 6d | 1536 by|tes from|
|00001710| 20 74 68 65 20 61 70 70 | 6c 69 63 61 74 69 6f 6e | the app|lication|
|00001720| d5 73 20 49 2f 4f 20 62 | 75 66 66 65 72 20 74 6f |.s I/O b|uffer to|
|00001730| 20 74 68 65 20 73 65 63 | 6f 6e 64 20 74 68 72 6f | the sec|ond thro|
|00001740| 75 67 68 20 66 6f 75 72 | 74 68 20 62 6c 6f 63 6b |ugh four|th block|
|00001750| 73 20 6f 66 20 74 68 65 | 20 66 69 6c 65 2e 0d 35 |s of the| file..5|
|00001760| 2e 09 52 65 61 64 20 74 | 68 65 20 66 69 66 74 68 |..Read t|he fifth|
|00001770| 20 62 6c 6f 63 6b 20 6f | 66 20 74 68 65 20 66 69 | block o|f the fi|
|00001780| 6c 65 20 69 6e 74 6f 20 | 61 20 66 69 6c 65 20 73 |le into |a file s|
|00001790| 79 73 74 65 6d 20 63 61 | 63 68 65 20 62 75 66 66 |ystem ca|che buff|
|000017a0| 65 72 2e 0d 36 2e 09 43 | 6f 70 79 20 35 30 20 62 |er..6..C|opy 50 b|
|000017b0| 79 74 65 73 20 66 72 6f | 6d 20 74 68 65 20 61 70 |ytes fro|m the ap|
|000017c0| 70 6c 69 63 61 74 69 6f | 6e d5 73 20 49 2f 4f 20 |plicatio|n.s I/O |
|000017d0| 62 75 66 66 65 72 20 69 | 6e 74 6f 20 74 68 65 20 |buffer i|nto the |
|000017e0| 63 61 63 68 65 20 62 75 | 66 66 65 72 20 73 74 61 |cache bu|ffer sta|
|000017f0| 72 74 69 6e 67 20 61 74 | 20 6f 66 66 73 65 74 ca |rting at| offset.|
|00001800| 30 2e 0d 37 2e 09 57 72 | 69 74 65 20 74 68 65 20 |0..7..Wr|ite the |
|00001810| 63 61 63 68 65 20 62 75 | 66 66 65 72 20 63 6f 6e |cache bu|ffer con|
|00001820| 74 61 69 6e 69 6e 67 20 | 74 68 65 20 66 69 66 74 |taining |the fift|
|00001830| 68 20 62 6c 6f 63 6b 20 | 6f 66 20 74 68 65 20 66 |h block |of the f|
|00001840| 69 6c 65 20 62 61 63 6b | 20 74 6f 20 74 68 65 20 |ile back| to the |
|00001850| 64 69 73 6b 2e 0d 42 79 | 20 6e 6f 74 20 62 6c 6f |disk..By| not blo|
|00001860| 63 6b 20 61 6c 69 67 6e | 69 6e 67 20 79 6f 75 72 |ck align|ing your|
|00001870| 20 49 2f 4f 2c 20 79 6f | 75 72 20 70 72 6f 67 72 | I/O, yo|ur progr|
|00001880| 61 6d d5 73 20 73 69 6e | 67 6c 65 20 6e 6f 6e 2d |am.s sin|gle non-|
|00001890| 62 6c 6f 63 6b 20 61 6c | 69 67 6e 65 64 20 77 72 |block al|igned wr|
|000018a0| 69 74 65 20 72 65 71 75 | 65 73 74 20 67 65 6e 65 |ite requ|est gene|
|000018b0| 72 61 74 65 64 20 74 77 | 6f 20 72 65 61 64 20 72 |rated tw|o read r|
|000018c0| 65 71 75 65 73 74 20 61 | 6e 64 20 74 68 72 65 65 |equest a|nd three|
|000018d0| 20 77 72 69 74 65 20 72 | 65 71 75 65 73 74 73 20 | write r|equests |
|000018e0| 74 6f 20 74 68 65 20 64 | 69 73 6b 20 64 72 69 76 |to the d|isk driv|
|000018f0| 65 72 2e 20 54 68 65 20 | 65 78 74 72 61 20 74 77 |er. The |extra tw|
|00001900| 6f 20 72 65 61 64 73 20 | 61 6e 64 20 74 77 6f 20 |o reads |and two |
|00001910| 77 72 69 74 65 73 20 69 | 6e 63 72 65 61 73 65 64 |writes i|ncreased|
|00001920| 20 74 68 65 20 72 65 71 | 75 65 73 74 20 6f 76 65 | the req|uest ove|
|00001930| 72 68 65 61 64 20 74 69 | 6d 65 20 62 79 20 34 30 |rhead ti|me by 40|
|00001940| 30 25 2e 20 49 66 20 74 | 68 65 20 73 61 6d 65 20 |0%. If t|he same |
|00001950| 73 69 7a 65 20 77 72 69 | 74 65 20 72 65 71 75 65 |size wri|te reque|
|00001960| 73 74 20 73 74 61 72 74 | 65 64 20 61 74 20 6f 66 |st start|ed at of|
|00001970| 66 73 65 74 20 30 20 69 | 6e 20 74 68 65 20 66 69 |fset 0 i|n the fi|
|00001980| 6c 65 2c 20 74 68 65 6e | 20 74 68 65 72 65 20 77 |le, then| there w|
|00001990| 6f 75 6c 64 20 68 61 76 | 65 20 62 65 65 6e 20 6f |ould hav|e been o|
|000019a0| 6e 6c 79 20 6f 6e 65 20 | 77 72 69 74 65 20 74 6f |nly one |write to|
|000019b0| 20 74 68 65 20 64 69 73 | 6b 20 64 72 69 76 65 72 | the dis|k driver|
|000019c0| 2e 0d 49 6d 70 6f 72 74 | 61 6e 74 3a 09 49 66 20 |..Import|ant:.If |
|000019d0| 79 6f 75 20 6d 61 6b 65 | 20 79 6f 75 72 20 72 65 |you make| your re|
|000019e0| 61 64 73 20 61 6e 64 20 | 77 72 69 74 65 73 20 73 |ads and |writes s|
|000019f0| 74 61 72 74 20 6f 6e 20 | 61 20 35 31 32 2d 62 79 |tart on |a 512-by|
|00001a00| 74 65 20 62 6f 75 6e 64 | 61 72 79 20 61 6e 64 20 |te bound|ary and |
|00001a10| 72 65 61 64 20 6f 72 20 | 77 72 69 74 65 20 69 6e |read or |write in|
|00001a20| 20 6d 75 6c 74 69 70 6c | 65 73 20 6f 66 20 35 31 | multipl|es of 51|
|00001a30| 32 2d 62 79 74 65 73 2c | 20 79 6f 75 27 6c 6c 20 |2-bytes,| you'll |
|00001a40| 61 76 6f 69 64 20 65 78 | 74 72 61 20 72 65 61 64 |avoid ex|tra read|
|00001a50| 20 61 6e 64 20 77 72 69 | 74 65 20 72 65 71 75 65 | and wri|te reque|
|00001a60| 73 74 73 20 61 6e 64 20 | 74 68 65 20 72 65 71 75 |sts and |the requ|
|00001a70| 65 73 74 20 6f 76 65 72 | 68 65 61 64 20 74 69 6d |est over|head tim|
|00001a80| 65 20 74 68 65 79 20 67 | 65 6e 65 72 61 74 65 2e |e they g|enerate.|
|00001a90| 0d 55 73 65 20 74 68 65 | 20 46 69 6c 65 20 53 79 |.Use the| File Sy|
|00001aa0| 73 74 65 6d d5 73 20 43 | 61 63 68 65 20 74 6f 20 |stem.s C|ache to |
|00001ab0| 79 6f 75 72 20 41 64 76 | 61 6e 74 61 67 65 0d 4e |your Adv|antage.N|
|00001ac0| 65 78 74 2c 20 79 6f 75 | 20 73 68 6f 75 6c 64 20 |ext, you| should |
|00001ad0| 6c 6f 6f 6b 20 61 74 20 | 68 6f 77 20 79 6f 75 72 |look at |how your|
|00001ae0| 20 70 72 6f 67 72 61 6d | 73 20 75 73 65 20 74 68 | program|s use th|
|00001af0| 65 20 64 61 74 61 20 74 | 68 65 79 20 72 65 61 64 |e data t|hey read|
|00001b00| 20 61 6e 64 20 77 72 69 | 74 65 2e 0d 54 68 65 20 | and wri|te..The |
|00001b10| 4d 61 63 69 6e 74 6f 73 | 68 20 46 69 6c 65 20 4d |Macintos|h File M|
|00001b20| 61 6e 61 67 65 72 d5 73 | 20 63 61 63 68 65 20 69 |anager.s| cache i|
|00001b30| 73 20 61 20 62 75 66 66 | 65 72 20 69 6e 20 52 41 |s a buff|er in RA|
|00001b40| 4d 20 6d 65 6d 6f 72 79 | 20 74 68 61 74 20 68 6f |M memory| that ho|
|00001b50| 6c 64 73 20 72 65 63 65 | 6e 74 6c 79 20 61 63 63 |lds rece|ntly acc|
|00001b60| 65 73 73 65 64 20 64 69 | 73 6b 20 62 6c 6f 63 6b |essed di|sk block|
|00001b70| 73 2e 20 49 66 20 74 68 | 65 20 64 61 74 61 20 77 |s. If th|e data w|
|00001b80| 61 73 20 72 65 61 64 20 | 66 72 6f 6d 20 74 68 65 |as read |from the|
|00001b90| 20 64 69 73 6b 20 69 6e | 74 6f 20 74 68 65 20 63 | disk in|to the c|
|00001ba0| 61 63 68 65 2c 20 73 75 | 62 73 65 71 75 65 6e 74 |ache, su|bsequent|
|00001bb0| 20 61 63 63 65 73 73 65 | 73 20 74 6f 20 74 68 6f | accesse|s to tho|
|00001bc0| 73 65 20 64 69 73 6b 73 | 20 62 6c 6f 63 6b 73 20 |se disks| blocks |
|00001bd0| 63 61 6e 20 63 6f 6d 65 | 20 66 72 6f 6d 20 74 68 |can come| from th|
|00001be0| 65 20 63 61 63 68 65 20 | 69 6e 73 74 65 61 64 20 |e cache |instead |
|00001bf0| 6f 66 20 63 61 75 73 69 | 6e 67 20 61 64 64 69 74 |of causi|ng addit|
|00001c00| 69 6f 6e 61 6c 20 64 69 | 73 6b 20 61 63 63 65 73 |ional di|sk acces|
|00001c10| 73 65 73 2e 20 49 66 20 | 64 61 74 61 20 77 61 73 |ses. If |data was|
|00001c20| 20 77 72 69 74 74 65 6e | 20 69 6e 74 6f 20 74 68 | written| into th|
|00001c30| 65 20 63 61 63 68 65 20 | 69 6e 73 74 65 61 64 20 |e cache |instead |
|00001c40| 6f 66 20 67 6f 69 6e 67 | 20 64 69 72 65 63 74 6c |of going| directl|
|00001c50| 79 20 74 6f 20 74 68 65 | 20 64 69 73 6b 2c 20 73 |y to the| disk, s|
|00001c60| 75 62 73 65 71 75 65 6e | 74 20 77 72 69 74 65 73 |ubsequen|t writes|
|00001c70| 20 74 6f 20 74 68 65 20 | 73 61 6d 65 20 64 69 73 | to the |same dis|
|00001c80| 6b 20 62 6c 6f 63 6b 20 | 77 6f 6e d5 74 20 63 61 |k block |won.t ca|
|00001c90| 75 73 65 20 61 6e 20 61 | 64 64 69 74 69 6f 6e 61 |use an a|dditiona|
|00001ca0| 6c 20 77 72 69 74 65 73 | 20 74 6f 20 74 68 6f 73 |l writes| to thos|
|00001cb0| 65 20 64 69 73 6b 20 62 | 6c 6f 63 6b 73 2e 20 28 |e disk b|locks. (|
|00001cc0| 43 61 63 68 65 20 62 6c | 6f 63 6b 73 20 74 68 61 |Cache bl|ocks tha|
|00001cd0| 74 20 63 6f 6e 74 61 69 | 6e 20 64 69 66 66 65 72 |t contai|n differ|
|00001ce0| 65 6e 74 20 64 61 74 61 | 20 74 68 61 6e 20 74 68 |ent data| than th|
|00001cf0| 65 20 64 69 73 6b 20 62 | 6c 6f 63 6b 20 74 68 65 |e disk b|lock the|
|00001d00| 79 20 61 72 65 20 61 73 | 73 6f 63 69 61 74 65 64 |y are as|sociated|
|00001d10| 20 77 69 74 68 20 61 72 | 65 20 d2 64 69 72 74 79 | with ar|e .dirty|
|00001d20| d3 20 63 61 63 68 65 20 | 62 6c 6f 63 6b 73 2e 29 |. cache |blocks.)|
|00001d30| 20 57 68 65 6e 20 75 73 | 65 64 20 74 68 69 73 20 | When us|ed this |
|00001d40| 77 61 79 2c 20 74 68 65 | 20 63 61 63 68 65 20 63 |way, the| cache c|
|00001d50| 61 6e 20 67 72 65 61 74 | 6c 79 20 69 6d 70 72 6f |an great|ly impro|
|00001d60| 76 65 20 74 68 65 20 70 | 65 72 66 6f 72 6d 61 6e |ve the p|erforman|
|00001d70| 63 65 20 6f 66 20 79 6f | 75 72 20 66 69 6c 65 20 |ce of yo|ur file |
|00001d80| 49 2f 4f 2e 0d 48 6f 77 | 65 76 65 72 2c 20 74 68 |I/O..How|ever, th|
|00001d90| 65 20 46 69 6c 65 20 4d | 61 6e 61 67 65 72 d5 73 |e File M|anager.s|
|00001da0| 20 63 61 63 68 65 20 64 | 6f 65 73 6e d5 74 20 68 | cache d|oesn.t h|
|00001db0| 61 76 65 20 69 6e 74 65 | 6c 6c 69 67 65 6e 63 65 |ave inte|lligence|
|00001dc0| 20 61 6c 6c 6f 77 69 6e | 67 20 69 74 20 74 6f 20 | allowin|g it to |
|00001dd0| 6b 6e 6f 77 20 68 6f 77 | 20 74 68 65 20 64 61 74 |know how| the dat|
|00001de0| 61 20 69 6e 20 74 68 65 | 20 63 61 63 68 65 20 69 |a in the| cache i|
|00001df0| 73 20 67 6f 69 6e 67 20 | 74 6f 20 62 65 20 75 73 |s going |to be us|
|00001e00| 65 64 2e 20 57 68 65 6e | 20 74 68 65 20 46 69 6c |ed. When| the Fil|
|00001e10| 65 20 4d 61 6e 61 67 65 | 72 20 73 65 6e 64 73 20 |e Manage|r sends |
|00001e20| 6d 75 6c 74 69 2d 62 6c | 6f 63 6b 20 66 69 6c 65 |multi-bl|ock file|
|00001e30| 20 49 2f 4f 20 72 65 71 | 75 65 73 74 73 20 74 68 | I/O req|uests th|
|00001e40| 72 6f 75 67 68 20 74 68 | 65 20 63 61 63 68 65 2c |rough th|e cache,|
|00001e50| 20 69 74 20 61 6c 77 61 | 79 73 20 63 61 63 68 65 | it alwa|ys cache|
|00001e60| 73 20 74 68 65 20 62 6c | 6f 63 6b 73 20 75 6e 6c |s the bl|ocks unl|
|00001e70| 65 73 73 20 74 68 65 20 | 73 69 7a 65 20 6f 66 20 |ess the |size of |
|00001e80| 74 68 65 20 72 65 71 75 | 65 73 74 20 69 73 20 76 |the requ|est is v|
|00001e90| 65 72 79 20 6c 61 72 67 | 65 20 6f 72 20 75 6e 6c |ery larg|e or unl|
|00001ea0| 65 73 73 20 69 74 d5 73 | 20 74 6f 6c 64 20 6e 6f |ess it.s| told no|
|00001eb0| 74 20 74 6f 20 69 6e 20 | 74 68 65 20 72 65 61 64 |t to in |the read|
|00001ec0| 20 6f 72 20 77 72 69 74 | 65 20 72 65 71 75 65 73 | or writ|e reques|
|00001ed0| 74 2e 20 54 68 65 20 63 | 61 63 68 65 64 20 62 6c |t. The c|ached bl|
|00001ee0| 6f 63 6b 73 20 73 74 61 | 79 20 69 6e 20 74 68 65 |ocks sta|y in the|
|00001ef0| 20 63 61 63 68 65 20 75 | 6e 74 69 6c 20 74 68 65 | cache u|ntil the|
|00001f00| 79 20 61 72 65 20 72 65 | 75 73 65 64 2c 20 75 6e |y are re|used, un|
|00001f10| 74 69 6c 20 74 68 65 20 | 66 69 6c 65 20 69 73 20 |til the |file is |
|00001f20| 63 6c 6f 73 65 64 2c 20 | 6f 72 20 75 6e 74 69 6c |closed, |or until|
|00001f30| 20 74 68 65 20 76 6f 6c | 75 6d 65 20 69 73 20 70 | the vol|ume is p|
|00001f40| 75 74 20 6f 66 66 6c 69 | 6e 65 2c 20 65 6a 65 63 |ut offli|ne, ejec|
|00001f50| 74 65 64 2c 20 6f 72 20 | 75 6e 6d 6f 75 6e 74 65 |ted, or |unmounte|
|00001f60| 64 2e 0d 55 6e 6c 65 73 | 73 20 79 6f 75 20 64 6f |d..Unles|s you do|
|00001f70| 20 73 6f 6d 65 74 68 69 | 6e 67 20 61 62 6f 75 74 | somethi|ng about|
|00001f80| 20 69 74 2c 20 72 65 61 | 64 73 20 61 6e 64 20 77 | it, rea|ds and w|
|00001f90| 72 69 74 65 73 20 74 68 | 61 74 20 68 61 76 65 20 |rites th|at have |
|00001fa0| 6e 6f 20 72 65 61 73 6f | 6e 20 74 6f 20 62 65 20 |no reaso|n to be |
|00001fb0| 63 61 63 68 65 64 20 77 | 69 6c 6c 20 62 65 20 63 |cached w|ill be c|
|00001fc0| 61 63 68 65 64 20 61 6e | 64 20 74 68 61 74 20 63 |ached an|d that c|
|00001fd0| 61 6e 20 63 61 75 73 65 | 20 69 6e 63 72 65 61 73 |an cause| increas|
|00001fe0| 65 73 20 69 6e 20 72 65 | 71 75 65 73 74 20 6f 76 |es in re|quest ov|
|00001ff0| 65 72 68 65 61 64 20 74 | 77 6f 20 77 61 79 73 3a |erhead t|wo ways:|
|00002000| 20 43 61 63 68 65 64 20 | 49 2f 4f 20 72 65 71 75 | Cached |I/O requ|
|00002010| 65 73 74 73 20 68 61 76 | 65 20 6d 6f 72 65 20 72 |ests hav|e more r|
|00002020| 65 71 75 65 73 74 20 6f | 76 65 72 68 65 61 64 20 |equest o|verhead |
|00002030| 61 6e 64 20 43 61 63 68 | 65 64 20 49 2f 4f 20 72 |and Cach|ed I/O r|
|00002040| 65 71 75 65 73 74 73 20 | 63 61 6e 20 66 6f 72 63 |equests |can forc|
|00002050| 65 20 6f 74 68 65 72 20 | 6d 6f 72 65 20 75 73 65 |e other |more use|
|00002060| 66 75 6c 20 63 61 63 68 | 65 64 20 64 61 74 61 20 |ful cach|ed data |
|00002070| 6f 75 74 20 6f 66 20 74 | 68 65 20 63 61 63 68 65 |out of t|he cache|
|00002080| 2e 0d 43 61 63 68 65 64 | 20 49 2f 4f 20 72 65 71 |..Cached| I/O req|
|00002090| 75 65 73 74 20 6f 76 65 | 72 68 65 61 64 20 63 61 |uest ove|rhead ca|
|000020a0| 6e 20 62 65 20 6d 69 6e | 69 6d 61 6c 20 61 73 20 |n be min|imal as |
|000020b0| 69 6e 20 74 68 65 20 63 | 61 73 65 20 77 68 65 72 |in the c|ase wher|
|000020c0| 65 20 74 68 65 20 72 65 | 71 75 65 73 74 20 69 73 |e the re|quest is|
|000020d0| 20 73 6d 61 6c 6c 20 65 | 6e 6f 75 67 68 20 74 6f | small e|nough to|
|000020e0| 20 75 73 65 20 6f 6e 6c | 79 20 75 6e 75 73 65 64 | use onl|y unused|
|000020f0| 20 62 6c 6f 63 6b 73 20 | 69 6e 20 74 68 65 20 63 | blocks |in the c|
|00002100| 61 63 68 65 2e 20 4f 72 | 2c 20 74 68 65 20 72 65 |ache. Or|, the re|
|00002110| 71 75 65 73 74 20 6f 76 | 65 72 68 65 61 64 20 63 |quest ov|erhead c|
|00002120| 61 6e 20 62 65 20 76 65 | 72 79 20 6c 61 72 67 65 |an be ve|ry large|
|00002130| 20 61 73 20 69 6e 20 74 | 68 65 20 63 61 73 65 20 | as in t|he case |
|00002140| 77 68 65 72 65 20 61 6c | 6c 20 6f 66 20 74 68 65 |where al|l of the|
|00002150| 20 62 6c 6f 63 6b 73 20 | 69 6e 20 74 68 65 20 63 | blocks |in the c|
|00002160| 61 63 68 65 20 61 72 65 | 20 69 6e 20 75 73 65 20 |ache are| in use |
|00002170| 61 6e 64 20 64 69 72 74 | 79 2c 20 61 6e 64 20 6d |and dirt|y, and m|
|00002180| 75 73 74 20 62 65 20 66 | 6c 75 73 68 65 64 20 74 |ust be f|lushed t|
|00002190| 6f 20 74 68 65 20 64 69 | 73 6b 20 62 65 66 6f 72 |o the di|sk befor|
|000021a0| 65 20 74 68 65 79 20 63 | 61 6e 20 62 65 20 72 65 |e they c|an be re|
|000021b0| 75 73 65 64 2e 0d 43 61 | 63 68 65 64 20 49 2f 4f |used..Ca|ched I/O|
|000021c0| 20 72 65 71 75 65 73 74 | 73 20 63 61 6e 20 66 6f | request|s can fo|
|000021d0| 72 63 65 20 6f 74 68 65 | 72 20 6d 6f 72 65 20 75 |rce othe|r more u|
|000021e0| 73 65 66 75 6c 20 63 61 | 63 68 65 64 20 64 61 74 |seful ca|ched dat|
|000021f0| 61 20 6f 75 74 20 6f 66 | 20 74 68 65 20 63 61 63 |a out of| the cac|
|00002200| 68 65 2e 20 41 73 20 61 | 6e 20 65 78 61 6d 70 6c |he. As a|n exampl|
|00002210| 65 2c 20 69 66 20 79 6f | 75 20 66 69 6c 6c 20 74 |e, if yo|u fill t|
|00002220| 68 65 20 63 61 63 68 65 | 20 77 69 74 68 20 64 61 |he cache| with da|
|00002230| 74 61 20 62 6c 6f 63 6b | 73 20 66 72 6f 6d 20 79 |ta block|s from y|
|00002240| 6f 75 72 20 66 69 6c 65 | 20 28 74 68 61 74 20 79 |our file| (that y|
|00002250| 6f 75 20 77 6f 6e d5 74 | 20 62 65 20 75 73 69 6e |ou won.t| be usin|
|00002260| 67 20 61 67 61 69 6e 20 | 69 6e 20 74 68 65 20 6e |g again |in the n|
|00002270| 65 61 72 20 66 75 74 75 | 72 65 29 2c 20 74 68 65 |ear futu|re), the|
|00002280| 6e 20 63 61 63 68 65 64 | 20 63 61 74 61 6c 6f 67 |n cached| catalog|
|00002290| 20 61 6e 64 20 76 6f 6c | 75 6d 65 20 69 6e 66 6f | and vol|ume info|
|000022a0| 72 6d 61 74 69 6f 6e 20 | 75 73 65 64 20 62 79 20 |rmation |used by |
|000022b0| 74 68 65 20 48 46 53 20 | 66 69 6c 65 20 73 79 73 |the HFS |file sys|
|000022c0| 74 65 6d 20 69 73 20 66 | 6c 75 73 68 65 64 20 6f |tem is f|lushed o|
|000022d0| 75 74 20 6f 66 20 74 68 | 65 20 63 61 63 68 65 2e |ut of th|e cache.|
|000022e0| 20 54 68 65 20 6e 65 78 | 74 20 74 69 6d 65 20 74 | The nex|t time t|
|000022f0| 68 65 20 48 46 53 20 66 | 69 6c 65 20 73 79 73 74 |he HFS f|ile syst|
|00002300| 65 6d 20 6e 65 65 64 73 | 20 74 6f 20 72 65 61 64 |em needs| to read|
|00002310| 20 74 68 65 20 63 61 74 | 61 6c 6f 67 2c 20 69 74 | the cat|alog, it|
|00002320| 20 77 69 6c 6c 20 68 61 | 76 65 20 74 6f 20 66 6c | will ha|ve to fl|
|00002330| 75 73 68 20 79 6f 75 72 | 20 63 61 63 68 65 64 20 |ush your| cached |
|00002340| 62 6c 6f 63 6b 73 20 6f | 75 74 20 6f 66 20 74 68 |blocks o|ut of th|
|00002350| 65 20 63 61 63 68 65 20 | 6a 75 73 74 20 74 6f 20 |e cache |just to |
|00002360| 72 65 6c 6f 61 64 20 74 | 68 65 20 64 61 74 61 20 |reload t|he data |
|00002370| 69 74 20 6e 65 65 64 73 | 2e 0d 53 6f 2c 20 62 79 |it needs|..So, by|
|00002380| 20 66 6f 6c 6c 6f 77 69 | 6e 67 20 74 68 65 20 66 | followi|ng the f|
|00002390| 6f 6c 6c 6f 77 69 6e 67 | 20 73 69 6d 70 6c 65 20 |ollowing| simple |
|000023a0| 67 75 69 64 65 6c 69 6e | 65 73 2c 20 6d 6f 73 74 |guidelin|es, most|
|000023b0| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 73 20 63 61 | applica|tions ca|
|000023c0| 6e 20 61 76 6f 69 64 20 | 62 6f 74 68 20 6f 66 20 |n avoid |both of |
|000023d0| 74 68 65 73 65 20 70 72 | 6f 62 6c 65 6d 73 20 61 |these pr|oblems a|
|000023e0| 6e 64 20 69 6e 63 72 65 | 61 73 65 20 74 68 65 20 |nd incre|ase the |
|000023f0| 66 69 6c 65 20 73 79 73 | 74 65 6d 20 70 65 72 66 |file sys|tem perf|
|00002400| 6f 72 6d 61 6e 63 65 20 | 66 6f 72 20 65 76 65 72 |ormance |for ever|
|00002410| 79 6f 6e 65 3a 0d 49 6d | 70 6f 72 74 61 6e 74 3a |yone:.Im|portant:|
|00002420| 09 a5 20 59 6f 75 20 73 | 68 6f 75 6c 64 20 63 61 |.. You s|hould ca|
|00002430| 63 68 65 20 72 65 61 64 | 73 20 61 6e 64 20 77 72 |che read|s and wr|
|00002440| 69 74 65 73 20 69 66 20 | 79 6f 75 20 72 65 61 64 |ites if |you read|
|00002450| 20 6f 72 20 77 72 69 74 | 65 20 74 68 65 20 73 61 | or writ|e the sa|
|00002460| 6d 65 20 70 6f 72 74 69 | 6f 6e 20 6f 66 20 61 20 |me porti|on of a |
|00002470| 66 69 6c 65 20 6d 75 6c | 74 69 70 6c 65 20 74 69 |file mul|tiple ti|
|00002480| 6d 65 73 2e 0d 09 a5 20 | 59 6f 75 20 73 68 6f 75 |mes.... |You shou|
|00002490| 6c 64 20 6e 6f 74 20 63 | 61 63 68 65 20 72 65 61 |ld not c|ache rea|
|000024a0| 64 73 20 61 6e 64 20 77 | 72 69 74 65 73 20 69 66 |ds and w|rites if|
|000024b0| 20 79 6f 75 20 72 65 61 | 64 20 6f 72 20 77 72 69 | you rea|d or wri|
|000024c0| 74 65 20 64 61 74 61 20 | 66 72 6f 6d 20 61 20 66 |te data |from a f|
|000024d0| 69 6c 65 20 6f 6e 6c 79 | 20 6f 6e 63 65 2e 0d 43 |ile only| once..C|
|000024e0| 6f 6e 74 72 6f 6c 6c 69 | 6e 67 20 74 68 65 20 43 |ontrolli|ng the C|
|000024f0| 61 63 68 65 0d 4f 75 74 | 20 77 69 74 68 20 74 68 |ache.Out| with th|
|00002500| 65 20 6f 6c 64 2c 20 69 | 6e 20 77 69 74 68 20 74 |e old, i|n with t|
|00002510| 68 65 20 6e 65 77 c9 0d | 57 61 72 6e 69 6e 67 3a |he new..|Warning:|
|00002520| 09 54 68 65 20 6f 6c 64 | 20 76 65 72 73 69 6f 6e |.The old| version|
|00002530| 20 6f 66 20 74 68 69 73 | 20 54 65 63 68 6e 69 63 | of this| Technic|
|00002540| 61 6c 20 4e 6f 74 65 20 | 72 65 63 6f 6d 6d 65 6e |al Note |recommen|
|00002550| 64 65 64 20 6d 61 6e 69 | 70 75 6c 61 74 69 6e 67 |ded mani|pulating|
|00002560| 20 74 68 65 20 6c 6f 77 | 2d 6d 65 6d 6f 72 79 20 | the low|-memory |
|00002570| 67 6c 6f 62 61 6c 20 43 | 61 63 68 65 43 6f 6d 20 |global C|acheCom |
|00002580| 74 6f 20 63 6f 6e 74 72 | 6f 6c 20 74 68 65 20 46 |to contr|ol the F|
|00002590| 69 6c 65 20 4d 61 6e 61 | 67 65 72 d5 73 20 63 61 |ile Mana|ger.s ca|
|000025a0| 63 68 65 2e 20 54 68 69 | 73 20 6d 65 74 68 6f 64 |che. Thi|s method|
|000025b0| 20 73 68 6f 75 6c 64 20 | 62 65 20 61 76 6f 69 64 | should |be avoid|
|000025c0| 65 64 20 62 65 63 61 75 | 73 65 3a 0d 09 a5 20 43 |ed becau|se:... C|
|000025d0| 61 63 68 65 43 6f 6d 20 | 69 73 20 6e 6f 20 6c 6f |acheCom |is no lo|
|000025e0| 6e 67 65 72 20 73 75 70 | 70 6f 72 74 65 64 20 6f |nger sup|ported o|
|000025f0| 6e 20 50 6f 77 65 72 20 | 4d 61 63 69 6e 74 6f 73 |n Power |Macintos|
|00002600| 68 20 73 79 73 74 65 6d | 73 20 66 6f 72 20 6e 61 |h system|s for na|
|00002610| 74 69 76 65 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |tive app|lication|
|00002620| 73 20 28 69 74 20 69 73 | 6e d5 74 20 69 6e 20 4c |s (it is|n.t in L|
|00002630| 6f 77 4d 65 6d 2e 68 29 | 20 61 6e 64 20 69 74 20 |owMem.h)| and it |
|00002640| 77 6f 6e d5 74 20 62 65 | 20 73 75 70 70 6f 72 74 |won.t be| support|
|00002650| 65 64 20 62 79 20 66 75 | 74 75 72 65 20 76 65 72 |ed by fu|ture ver|
|00002660| 73 69 6f 6e 73 20 6f 66 | 20 74 68 65 20 46 69 6c |sions of| the Fil|
|00002670| 65 20 4d 61 6e 61 67 65 | 72 2e 0d 09 a5 20 43 61 |e Manage|r.... Ca|
|00002680| 63 68 65 43 6f 6d 20 61 | 66 66 65 63 74 73 20 74 |cheCom a|ffects t|
|00002690| 68 65 20 73 79 73 74 65 | 6d 20 67 6c 6f 62 61 6c |he syste|m global|
|000026a0| 6c 79 2e 20 54 68 61 74 | 20 6d 65 61 6e 73 20 74 |ly. That| means t|
|000026b0| 68 61 74 20 79 6f 75 72 | 20 63 6f 64 65 20 61 66 |hat your| code af|
|000026c0| 66 65 63 74 73 20 61 6c | 6c 20 6f 74 68 65 72 20 |fects al|l other |
|000026d0| 72 75 6e 6e 69 6e 67 20 | 70 72 6f 67 72 61 6d 73 |running |programs|
|000026e0| 20 74 68 61 74 20 72 65 | 61 64 20 6f 72 20 77 72 | that re|ad or wr|
|000026f0| 69 74 65 20 61 6e 64 20 | 74 68 61 74 d5 73 20 6e |ite and |that.s n|
|00002700| 6f 74 20 61 20 66 72 69 | 65 6e 64 6c 79 20 74 68 |ot a fri|endly th|
|00002710| 69 6e 67 20 74 6f 20 64 | 6f 20 69 6e 20 61 20 6d |ing to d|o in a m|
|00002720| 75 6c 74 69 2d 70 72 6f | 63 65 73 73 20 65 6e 76 |ulti-pro|cess env|
|00002730| 69 72 6f 6e 6d 65 6e 74 | 2e 0d 53 6f 2c 20 68 6f |ironment|..So, ho|
|00002740| 77 20 64 6f 20 79 6f 75 | 20 63 6f 6e 74 72 6f 6c |w do you| control|
|00002750| 20 77 68 61 74 20 67 65 | 74 73 20 63 61 63 68 65 | what ge|ts cache|
|00002760| 64 20 61 6e 64 20 77 68 | 61 74 20 64 6f 65 73 6e |d and wh|at doesn|
|00002770| d5 74 3f 20 49 6e 20 61 | 20 50 42 52 65 61 64 20 |.t? In a| PBRead |
|00002780| 6f 72 20 50 42 57 72 69 | 74 65 20 72 65 71 75 65 |or PBWri|te reque|
|00002790| 73 74 2c 20 62 69 74 73 | 20 34 20 61 6e 64 20 35 |st, bits| 4 and 5|
|000027a0| 20 6f 66 20 69 6f 50 6f | 73 4d 6f 64 65 20 61 72 | of ioPo|sMode ar|
|000027b0| 65 20 63 61 63 68 65 20 | 75 73 61 67 65 20 68 69 |e cache |usage hi|
|000027c0| 6e 74 73 20 70 61 73 73 | 65 64 20 6f 6e 20 74 6f |nts pass|ed on to|
|000027d0| 20 74 68 65 20 66 69 6c | 65 20 73 79 73 74 65 6d | the fil|e system|
|000027e0| 20 74 68 61 74 20 68 61 | 6e 64 6c 65 73 20 72 65 | that ha|ndles re|
|000027f0| 71 75 65 73 74 73 20 74 | 6f 20 74 68 65 20 76 6f |quests t|o the vo|
|00002800| 6c 75 6d 65 20 74 68 65 | 20 66 69 6c 65 20 69 73 |lume the| file is|
|00002810| 20 6f 6e 20 28 74 68 65 | 20 63 61 63 68 65 20 63 | on (the| cache c|
|00002820| 6f 6e 74 72 6f 6c 20 62 | 69 74 73 20 61 72 65 20 |ontrol b|its are |
|00002830| 61 6c 73 6f 20 64 6f 63 | 75 6d 65 6e 74 65 64 20 |also doc|umented |
|00002840| 6f 6e 20 70 61 67 65 73 | 20 32 2d 38 39 20 61 6e |on pages| 2-89 an|
|00002850| 64 20 32 2d 39 35 20 6f | 66 20 49 6e 73 69 64 65 |d 2-95 o|f Inside|
|00002860| 20 4d 61 63 69 6e 74 6f | 73 68 3a 20 46 69 6c 65 | Macinto|sh: File|
|00002870| 73 20 61 6e 64 20 69 6e | 20 74 68 65 20 54 65 63 |s and in| the Tec|
|00002880| 68 6e 69 63 61 6c 20 4e | 6f 74 65 20 d2 49 6e 73 |hnical N|ote .Ins|
|00002890| 69 64 65 20 4d 61 63 69 | 6e 74 6f 73 68 d1 46 69 |ide Maci|ntosh.Fi|
|000028a0| 6c 65 73 20 45 72 72 61 | 74 61 d3 29 2e 20 42 69 |les Erra|ta.). Bi|
|000028b0| 74 20 34 20 69 73 20 61 | 20 72 65 71 75 65 73 74 |t 4 is a| request|
|000028c0| 20 74 68 61 74 20 74 68 | 65 20 64 61 74 61 20 62 | that th|e data b|
|000028d0| 65 20 63 61 63 68 65 64 | 20 28 69 2e 65 2e 2c 20 |e cached| (i.e., |
|000028e0| 70 6c 65 61 73 65 20 63 | 61 63 68 65 20 74 68 69 |please c|ache thi|
|000028f0| 73 29 2e 20 42 69 74 20 | 35 20 69 73 20 61 20 72 |s). Bit |5 is a r|
|00002900| 65 71 75 65 73 74 20 74 | 68 61 74 20 74 68 65 20 |equest t|hat the |
|00002910| 64 61 74 61 20 6e 6f 74 | 20 62 65 20 63 61 63 68 |data not| be cach|
|00002920| 65 64 20 28 69 2e 65 2e | 2c 20 70 6c 65 61 73 65 |ed (i.e.|, please|
|00002930| 20 64 6f 20 6e 6f 74 20 | 63 61 63 68 65 20 74 68 | do not |cache th|
|00002940| 69 73 29 2e 20 42 69 74 | 73 20 34 20 61 6e 64 20 |is). Bit|s 4 and |
|00002950| 35 20 61 72 65 20 6d 75 | 74 75 61 6c 6c 79 20 65 |5 are mu|tually e|
|00002960| 78 63 6c 75 73 69 76 65 | 20 2d 20 6f 6e 6c 79 20 |xclusive| - only |
|00002970| 6f 6e 65 20 73 68 6f 75 | 6c 64 20 62 65 20 73 65 |one shou|ld be se|
|00002980| 74 20 61 74 20 61 20 74 | 69 6d 65 2e 20 48 6f 77 |t at a t|ime. How|
|00002990| 65 76 65 72 2c 20 69 66 | 20 6e 65 69 74 68 65 72 |ever, if| neither|
|000029a0| 20 69 73 20 73 65 74 2c | 20 74 68 65 6e 20 74 68 | is set,| then th|
|000029b0| 65 20 70 72 6f 67 72 61 | 6d 20 68 61 73 20 69 6e |e progra|m has in|
|000029c0| 64 69 63 61 74 65 64 20 | 74 68 61 74 20 69 74 20 |dicated |that it |
|000029d0| 64 6f 65 73 6e d5 74 20 | 63 61 72 65 20 69 66 20 |doesn.t |care if |
|000029e0| 74 68 65 20 64 61 74 61 | 20 69 73 20 63 61 63 68 |the data| is cach|
|000029f0| 65 64 20 6f 72 20 6e 6f | 74 2e 20 54 68 65 20 76 |ed or no|t. The v|
|00002a00| 61 6c 75 65 73 20 61 6c | 6c 6f 77 65 64 20 69 6e |alues al|lowed in|
|00002a10| 20 69 6f 50 6f 73 4d 6f | 64 65 20 74 6f 20 73 65 | ioPosMo|de to se|
|00002a20| 74 20 62 69 74 73 20 34 | 20 61 6e 64 20 35 20 61 |t bits 4| and 5 a|
|00002a30| 72 65 3a 0d 42 69 74 20 | 6e 75 6d 62 65 72 09 4d |re:.Bit |number.M|
|00002a40| 61 73 6b 20 76 61 6c 75 | 65 09 44 65 73 63 72 69 |ask valu|e.Descri|
|00002a50| 70 74 69 6f 6e 0d 6e 2f | 61 09 30 78 30 30 30 30 |ption.n/|a.0x0000|
|00002a60| 09 49 20 64 6f 6e d5 74 | 20 63 61 72 65 20 69 66 |.I don.t| care if|
|00002a70| 20 74 68 69 73 20 72 65 | 71 75 65 73 74 20 69 73 | this re|quest is|
|00002a80| 20 63 61 63 68 65 64 20 | 6f 72 20 6e 6f 74 20 63 | cached |or not c|
|00002a90| 61 63 68 65 64 2e 0d 34 | 09 30 78 30 30 31 30 09 |ached..4|.0x0010.|
|00002aa0| 50 6c 65 61 73 65 2c 20 | 63 61 63 68 65 20 74 68 |Please, |cache th|
|00002ab0| 69 73 20 72 65 71 75 65 | 73 74 20 69 66 20 70 6f |is reque|st if po|
|00002ac0| 73 73 69 62 6c 65 2e 0d | 35 09 30 78 30 30 32 30 |ssible..|5.0x0020|
|00002ad0| 09 50 6c 65 61 73 65 2c | 20 49 d5 64 20 72 61 74 |.Please,| I.d rat|
|00002ae0| 68 65 72 20 79 6f 75 20 | 64 69 64 6e d5 74 20 63 |her you |didn.t c|
|00002af0| 61 63 68 65 20 74 68 69 | 73 20 72 65 71 75 65 73 |ache thi|s reques|
|00002b00| 74 2e 0d 4e 6f 74 65 3a | 09 41 20 70 61 72 74 69 |t..Note:|.A parti|
|00002b10| 63 75 6c 61 72 20 66 69 | 6c 65 20 73 79 73 74 65 |cular fi|le syste|
|00002b20| 6d 20 28 48 46 53 2c 20 | 41 70 70 6c 65 53 68 61 |m (HFS, |AppleSha|
|00002b30| 72 65 2c 20 49 53 4f 2d | 39 36 36 30 2c 20 65 74 |re, ISO-|9660, et|
|00002b40| 63 2e 29 20 6d 61 79 20 | 63 68 6f 6f 73 65 20 74 |c.) may |choose t|
|00002b50| 6f 20 69 67 6e 6f 72 65 | 20 6f 6e 65 20 6f 72 20 |o ignore| one or |
|00002b60| 62 6f 74 68 20 6f 66 20 | 74 68 65 20 63 61 63 68 |both of |the cach|
|00002b70| 65 20 75 73 61 67 65 20 | 68 69 6e 74 20 62 69 74 |e usage |hint bit|
|00002b80| 73 2e 20 46 6f 72 20 65 | 78 61 6d 70 6c 65 2c 20 |s. For e|xample, |
|00002b90| 74 68 65 20 48 46 53 20 | 66 69 6c 65 20 73 79 73 |the HFS |file sys|
|00002ba0| 74 65 6d 20 69 67 6e 6f | 72 65 73 20 62 69 74 20 |tem igno|res bit |
|00002bb0| 34 2e 20 46 69 6c 65 20 | 73 79 73 74 65 6d 73 20 |4. File |systems |
|00002bc0| 6d 61 79 20 63 61 63 68 | 65 20 77 68 65 6e 20 79 |may cach|e when y|
|00002bd0| 6f 75 20 73 65 74 20 62 | 69 74 20 35 2c 20 6d 61 |ou set b|it 5, ma|
|00002be0| 79 20 6e 6f 74 20 63 61 | 63 68 65 20 77 68 65 6e |y not ca|che when|
|00002bf0| 20 79 6f 75 20 73 65 74 | 20 74 68 65 20 62 69 74 | you set| the bit|
|00002c00| 20 34 2c 20 6d 61 79 20 | 63 61 63 68 65 20 65 76 | 4, may |cache ev|
|00002c10| 65 72 79 74 68 69 6e 67 | 2c 20 6f 72 20 6d 61 79 |erything|, or may|
|00002c20| 20 63 61 63 68 65 20 6e | 6f 74 68 69 6e 67 2e 20 | cache n|othing. |
|00002c30| 48 6f 77 65 76 65 72 2c | 20 69 66 20 61 20 70 72 |However,| if a pr|
|00002c40| 6f 67 72 61 6d 20 6c 65 | 61 76 65 73 20 62 6f 74 |ogram le|aves bot|
|00002c50| 68 20 62 69 74 73 20 63 | 6c 65 61 72 2c 20 74 68 |h bits c|lear, th|
|00002c60| 65 6e 20 66 69 6c 65 20 | 73 79 73 74 65 6d 73 20 |en file |systems |
|00002c70| 77 68 69 63 68 20 64 6f | 20 72 65 73 70 65 63 74 |which do| respect|
|00002c80| 20 74 68 65 20 63 61 63 | 68 65 20 68 69 6e 74 20 | the cac|he hint |
|00002c90| 62 69 74 73 20 68 61 76 | 65 20 6e 6f 20 77 61 79 |bits hav|e no way|
|00002ca0| 20 6f 66 20 6b 6e 6f 77 | 69 6e 67 20 69 66 20 74 | of know|ing if t|
|00002cb0| 68 65 20 64 61 74 61 20 | 62 65 69 6e 67 20 72 65 |he data |being re|
|00002cc0| 61 64 20 6f 72 20 77 72 | 69 74 74 65 6e 20 77 69 |ad or wr|itten wi|
|00002cd0| 6c 6c 20 62 65 20 6e 65 | 65 64 65 64 20 61 67 61 |ll be ne|eded aga|
|00002ce0| 69 6e 20 62 79 20 79 6f | 75 72 20 70 72 6f 67 72 |in by yo|ur progr|
|00002cf0| 61 6d 2e 0d 54 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |am..The |followin|
|00002d00| 67 20 66 6f 75 72 20 68 | 69 67 68 2d 6c 65 76 65 |g four h|igh-leve|
|00002d10| 6c 20 66 75 6e 63 74 69 | 6f 6e 73 20 73 68 6f 77 |l functi|ons show|
|00002d20| 20 68 6f 77 20 74 6f 20 | 72 65 61 64 20 61 6e 64 | how to |read and|
|00002d30| 20 77 72 69 74 65 20 75 | 73 69 6e 67 20 74 68 65 | write u|sing the|
|00002d40| 20 63 61 63 68 65 20 68 | 69 6e 74 20 62 69 74 73 | cache h|int bits|
|00002d50| 2e 0d 20 20 20 20 65 6e | 75 6d 0d 20 20 20 20 7b |.. en|um. {|
|00002d60| 0d 20 20 20 20 20 20 20 | 20 6b 43 61 63 68 65 4d |. | kCacheM|
|00002d70| 61 73 6b 20 20 20 3d 20 | 30 78 30 30 31 30 2c 0d |ask = |0x0010,.|
|00002d80| 20 20 20 20 20 20 20 20 | 6b 4e 6f 43 61 63 68 65 | |kNoCache|
|00002d90| 4d 61 73 6b 20 3d 20 30 | 78 30 30 32 30 0d 20 20 |Mask = 0|x0020. |
|00002da0| 20 20 7d 3b 0d 20 20 20 | 20 70 61 73 63 61 6c 20 | };. | pascal |
|00002db0| 4f 53 45 72 72 20 46 53 | 52 65 61 64 4e 6f 43 61 |OSErr FS|ReadNoCa|
|00002dc0| 63 68 65 28 73 68 6f 72 | 74 20 72 65 66 4e 75 6d |che(shor|t refNum|
|00002dd0| 2c 20 6c 6f 6e 67 20 2a | 63 6f 75 6e 74 2c 20 76 |, long *|count, v|
|00002de0| 6f 69 64 20 2a 62 75 66 | 66 50 74 72 29 0d 20 20 |oid *buf|fPtr). |
|00002df0| 20 20 7b 0d 20 20 20 20 | 20 20 20 20 50 61 72 61 | {. | Para|
|00002e00| 6d 42 6c 6f 63 6b 52 65 | 63 20 70 62 3b 0d 20 20 |mBlockRe|c pb;. |
|00002e10| 20 20 20 20 20 20 4f 53 | 45 72 72 20 65 72 72 6f | OS|Err erro|
|00002e20| 72 3b 0d 20 20 20 20 20 | 20 20 20 0d 20 20 20 20 |r;. | . |
|00002e30| 20 20 20 20 70 62 2e 69 | 6f 50 61 72 61 6d 2e 69 | pb.i|oParam.i|
|00002e40| 6f 52 65 66 4e 75 6d 20 | 3d 20 72 65 66 4e 75 6d |oRefNum |= refNum|
|00002e50| 3b 0d 20 20 20 20 20 20 | 20 20 70 62 2e 69 6f 50 |;. | pb.ioP|
|00002e60| 61 72 61 6d 2e 69 6f 42 | 75 66 66 65 72 20 3d 20 |aram.ioB|uffer = |
|00002e70| 28 50 74 72 29 62 75 66 | 66 50 74 72 3b 0d 20 20 |(Ptr)buf|fPtr;. |
|00002e80| 20 20 20 20 20 20 70 62 | 2e 69 6f 50 61 72 61 6d | pb|.ioParam|
|00002e90| 2e 69 6f 52 65 71 43 6f | 75 6e 74 20 3d 20 2a 63 |.ioReqCo|unt = *c|
|00002ea0| 6f 75 6e 74 3b 0d 20 20 | 20 20 20 20 20 20 70 62 |ount;. | pb|
|00002eb0| 2e 69 6f 50 61 72 61 6d | 2e 69 6f 50 6f 73 4d 6f |.ioParam|.ioPosMo|
|00002ec0| 64 65 20 3d 20 66 73 41 | 74 4d 61 72 6b 20 2b 20 |de = fsA|tMark + |
|00002ed0| 6b 4e 6f 43 61 63 68 65 | 4d 61 73 6b 3b 0d 20 20 |kNoCache|Mask;. |
|00002ee0| 20 20 20 20 20 20 70 62 | 2e 69 6f 50 61 72 61 6d | pb|.ioParam|
|00002ef0| 2e 69 6f 50 6f 73 4f 66 | 66 73 65 74 20 3d 20 30 |.ioPosOf|fset = 0|
|00002f00| 3b 0d 20 20 20 20 20 20 | 20 20 65 72 72 6f 72 20 |;. | error |
|00002f10| 3d 20 50 42 52 65 61 64 | 53 79 6e 63 28 26 70 62 |= PBRead|Sync(&pb|
|00002f20| 29 3b 0d 20 20 20 20 20 | 20 20 20 2a 63 6f 75 6e |);. | *coun|
|00002f30| 74 20 3d 20 70 62 2e 69 | 6f 50 61 72 61 6d 2e 69 |t = pb.i|oParam.i|
|00002f40| 6f 41 63 74 43 6f 75 6e | 74 3b 0d 20 20 20 20 20 |oActCoun|t;. |
|00002f50| 20 20 20 72 65 74 75 72 | 6e 20 28 20 65 72 72 6f | retur|n ( erro|
|00002f60| 72 20 29 3b 0d 20 20 20 | 20 7d 0d 20 20 20 20 70 |r );. | }. p|
|00002f70| 61 73 63 61 6c 20 4f 53 | 45 72 72 20 46 53 57 72 |ascal OS|Err FSWr|
|00002f80| 69 74 65 4e 6f 43 61 63 | 68 65 28 73 68 6f 72 74 |iteNoCac|he(short|
|00002f90| 20 72 65 66 4e 75 6d 2c | 20 6c 6f 6e 67 20 2a 63 | refNum,| long *c|
|00002fa0| 6f 75 6e 74 2c 20 63 6f | 6e 73 74 20 76 6f 69 64 |ount, co|nst void|
|00002fb0| 20 2a 62 75 66 66 50 74 | 72 29 0d 20 20 20 20 7b | *buffPt|r). {|
|00002fc0| 0d 20 20 20 20 20 20 20 | 20 50 61 72 61 6d 42 6c |. | ParamBl|
|00002fd0| 6f 63 6b 52 65 63 20 70 | 62 3b 0d 20 20 20 20 20 |ockRec p|b;. |
|00002fe0| 20 20 20 4f 53 45 72 72 | 20 65 72 72 6f 72 3b 0d | OSErr| error;.|
|00002ff0| 20 20 20 20 20 20 20 20 | 0d 20 20 20 20 20 20 20 | |. |
|00003000| 20 70 62 2e 69 6f 50 61 | 72 61 6d 2e 69 6f 52 65 | pb.ioPa|ram.ioRe|
|00003010| 66 4e 75 6d 20 3d 20 72 | 65 66 4e 75 6d 3b 0d 20 |fNum = r|efNum;. |
|00003020| 20 20 20 20 20 20 20 70 | 62 2e 69 6f 50 61 72 61 | p|b.ioPara|
|00003030| 6d 2e 69 6f 42 75 66 66 | 65 72 20 3d 20 28 50 74 |m.ioBuff|er = (Pt|
|00003040| 72 29 62 75 66 66 50 74 | 72 3b 0d 20 20 20 20 20 |r)buffPt|r;. |
|00003050| 20 20 20 70 62 2e 69 6f | 50 61 72 61 6d 2e 69 6f | pb.io|Param.io|
|00003060| 52 65 71 43 6f 75 6e 74 | 20 3d 20 2a 63 6f 75 6e |ReqCount| = *coun|
|00003070| 74 3b 0d 20 20 20 20 20 | 20 20 20 70 62 2e 69 6f |t;. | pb.io|
|00003080| 50 61 72 61 6d 2e 69 6f | 50 6f 73 4d 6f 64 65 20 |Param.io|PosMode |
|00003090| 3d 20 66 73 41 74 4d 61 | 72 6b 20 2b 20 6b 4e 6f |= fsAtMa|rk + kNo|
|000030a0| 43 61 63 68 65 4d 61 73 | 6b 3b 0d 20 20 20 20 20 |CacheMas|k;. |
|000030b0| 20 20 20 70 62 2e 69 6f | 50 61 72 61 6d 2e 69 6f | pb.io|Param.io|
|000030c0| 50 6f 73 4f 66 66 73 65 | 74 20 3d 20 30 3b 0d 20 |PosOffse|t = 0;. |
|000030d0| 20 20 20 20 20 20 20 65 | 72 72 6f 72 20 3d 20 50 | e|rror = P|
|000030e0| 42 57 72 69 74 65 53 79 | 6e 63 28 26 70 62 29 3b |BWriteSy|nc(&pb);|
|000030f0| 0d 20 20 20 20 20 20 20 | 20 2a 63 6f 75 6e 74 20 |. | *count |
|00003100| 3d 20 70 62 2e 69 6f 50 | 61 72 61 6d 2e 69 6f 41 |= pb.ioP|aram.ioA|
|00003110| 63 74 43 6f 75 6e 74 3b | 0d 20 20 20 20 20 20 20 |ctCount;|. |
|00003120| 20 72 65 74 75 72 6e 20 | 28 20 65 72 72 6f 72 20 | return |( error |
|00003130| 29 3b 0d 20 20 20 20 7d | 0d 20 20 20 20 70 61 73 |);. }|. pas|
|00003140| 63 61 6c 20 4f 53 45 72 | 72 20 46 53 52 65 61 64 |cal OSEr|r FSRead|
|00003150| 43 61 63 68 65 28 73 68 | 6f 72 74 20 72 65 66 4e |Cache(sh|ort refN|
|00003160| 75 6d 2c 20 6c 6f 6e 67 | 20 2a 63 6f 75 6e 74 2c |um, long| *count,|
|00003170| 20 76 6f 69 64 20 2a 62 | 75 66 66 50 74 72 29 0d | void *b|uffPtr).|
|00003180| 20 20 20 20 7b 0d 20 20 | 20 20 20 20 20 20 50 61 | {. | Pa|
|00003190| 72 61 6d 42 6c 6f 63 6b | 52 65 63 20 70 62 3b 0d |ramBlock|Rec pb;.|
|000031a0| 20 20 20 20 20 20 20 20 | 4f 53 45 72 72 20 65 72 | |OSErr er|
|000031b0| 72 6f 72 3b 0d 20 20 20 | 20 20 20 20 20 0d 20 20 |ror;. | . |
|000031c0| 20 20 20 20 20 20 70 62 | 2e 69 6f 50 61 72 61 6d | pb|.ioParam|
|000031d0| 2e 69 6f 52 65 66 4e 75 | 6d 20 3d 20 72 65 66 4e |.ioRefNu|m = refN|
|000031e0| 75 6d 3b 0d 20 20 20 20 | 20 20 20 20 70 62 2e 69 |um;. | pb.i|
|000031f0| 6f 50 61 72 61 6d 2e 69 | 6f 42 75 66 66 65 72 20 |oParam.i|oBuffer |
|00003200| 3d 20 28 50 74 72 29 62 | 75 66 66 50 74 72 3b 0d |= (Ptr)b|uffPtr;.|
|00003210| 20 20 20 20 20 20 20 20 | 70 62 2e 69 6f 50 61 72 | |pb.ioPar|
|00003220| 61 6d 2e 69 6f 52 65 71 | 43 6f 75 6e 74 20 3d 20 |am.ioReq|Count = |
|00003230| 2a 63 6f 75 6e 74 3b 0d | 20 20 20 20 20 20 20 20 |*count;.| |
|00003240| 70 62 2e 69 6f 50 61 72 | 61 6d 2e 69 6f 50 6f 73 |pb.ioPar|am.ioPos|
|00003250| 4d 6f 64 65 20 3d 20 66 | 73 41 74 4d 61 72 6b 20 |Mode = f|sAtMark |
|00003260| 2b 20 6b 43 61 63 68 65 | 4d 61 73 6b 3b 0d 20 20 |+ kCache|Mask;. |
|00003270| 20 20 20 20 20 20 70 62 | 2e 69 6f 50 61 72 61 6d | pb|.ioParam|
|00003280| 2e 69 6f 50 6f 73 4f 66 | 66 73 65 74 20 3d 20 30 |.ioPosOf|fset = 0|
|00003290| 3b 0d 20 20 20 20 20 20 | 20 20 65 72 72 6f 72 20 |;. | error |
|000032a0| 3d 20 50 42 52 65 61 64 | 53 79 6e 63 28 26 70 62 |= PBRead|Sync(&pb|
|000032b0| 29 3b 0d 20 20 20 20 20 | 20 20 20 2a 63 6f 75 6e |);. | *coun|
|000032c0| 74 20 3d 20 70 62 2e 69 | 6f 50 61 72 61 6d 2e 69 |t = pb.i|oParam.i|
|000032d0| 6f 41 63 74 43 6f 75 6e | 74 3b 0d 20 20 20 20 20 |oActCoun|t;. |
|000032e0| 20 20 20 72 65 74 75 72 | 6e 20 28 20 65 72 72 6f | retur|n ( erro|
|000032f0| 72 20 29 3b 0d 20 20 20 | 20 7d 0d 20 20 20 20 70 |r );. | }. p|
|00003300| 61 73 63 61 6c 20 4f 53 | 45 72 72 20 46 53 57 72 |ascal OS|Err FSWr|
|00003310| 69 74 65 43 61 63 68 65 | 28 73 68 6f 72 74 20 72 |iteCache|(short r|
|00003320| 65 66 4e 75 6d 2c 20 6c | 6f 6e 67 20 2a 63 6f 75 |efNum, l|ong *cou|
|00003330| 6e 74 2c 20 63 6f 6e 73 | 74 20 76 6f 69 64 20 2a |nt, cons|t void *|
|00003340| 62 75 66 66 50 74 72 29 | 0d 20 20 20 20 7b 0d 20 |buffPtr)|. {. |
|00003350| 20 20 20 20 20 20 20 50 | 61 72 61 6d 42 6c 6f 63 | P|aramBloc|
|00003360| 6b 52 65 63 20 70 62 3b | 0d 20 20 20 20 20 20 20 |kRec pb;|. |
|00003370| 20 4f 53 45 72 72 20 65 | 72 72 6f 72 3b 0d 20 20 | OSErr e|rror;. |
|00003380| 20 20 20 20 20 20 0d 20 | 20 20 20 20 20 20 20 70 | . | p|
|00003390| 62 2e 69 6f 50 61 72 61 | 6d 2e 69 6f 52 65 66 4e |b.ioPara|m.ioRefN|
|000033a0| 75 6d 20 3d 20 72 65 66 | 4e 75 6d 3b 0d 20 20 20 |um = ref|Num;. |
|000033b0| 20 20 20 20 20 70 62 2e | 69 6f 50 61 72 61 6d 2e | pb.|ioParam.|
|000033c0| 69 6f 42 75 66 66 65 72 | 20 3d 20 28 50 74 72 29 |ioBuffer| = (Ptr)|
|000033d0| 62 75 66 66 50 74 72 3b | 0d 20 20 20 20 20 20 20 |buffPtr;|. |
|000033e0| 20 70 62 2e 69 6f 50 61 | 72 61 6d 2e 69 6f 52 65 | pb.ioPa|ram.ioRe|
|000033f0| 71 43 6f 75 6e 74 20 3d | 20 2a 63 6f 75 6e 74 3b |qCount =| *count;|
|00003400| 0d 20 20 20 20 20 20 20 | 20 70 62 2e 69 6f 50 61 |. | pb.ioPa|
|00003410| 72 61 6d 2e 69 6f 50 6f | 73 4d 6f 64 65 20 3d 20 |ram.ioPo|sMode = |
|00003420| 66 73 41 74 4d 61 72 6b | 20 2b 20 6b 43 61 63 68 |fsAtMark| + kCach|
|00003430| 65 4d 61 73 6b 3b 0d 20 | 20 20 20 20 20 20 20 70 |eMask;. | p|
|00003440| 62 2e 69 6f 50 61 72 61 | 6d 2e 69 6f 50 6f 73 4f |b.ioPara|m.ioPosO|
|00003450| 66 66 73 65 74 20 3d 20 | 30 3b 0d 20 20 20 20 20 |ffset = |0;. |
|00003460| 20 20 20 65 72 72 6f 72 | 20 3d 20 50 42 57 72 69 | error| = PBWri|
|00003470| 74 65 53 79 6e 63 28 26 | 70 62 29 3b 0d 20 20 20 |teSync(&|pb);. |
|00003480| 20 20 20 20 20 2a 63 6f | 75 6e 74 20 3d 20 70 62 | *co|unt = pb|
|00003490| 2e 69 6f 50 61 72 61 6d | 2e 69 6f 41 63 74 43 6f |.ioParam|.ioActCo|
|000034a0| 75 6e 74 3b 0d 20 20 20 | 20 20 20 20 20 72 65 74 |unt;. | ret|
|000034b0| 75 72 6e 20 28 20 65 72 | 72 6f 72 20 29 3b 0d 20 |urn ( er|ror );. |
|000034c0| 20 20 20 7d 0d 42 61 6c | 61 6e 63 69 6e 67 20 43 | }.Bal|ancing C|
|000034d0| 61 63 68 65 64 20 49 2f | 4f 20 50 65 72 66 6f 72 |ached I/|O Perfor|
|000034e0| 6d 61 6e 63 65 20 61 6e | 64 20 44 61 74 61 20 49 |mance an|d Data I|
|000034f0| 6e 74 65 67 72 69 74 79 | 0d 54 68 65 20 46 69 6c |ntegrity|.The Fil|
|00003500| 65 20 4d 61 6e 61 67 65 | 72 d5 73 20 63 61 63 68 |e Manage|r.s cach|
|00003510| 65 20 63 61 6e 20 69 6e | 63 72 65 61 73 65 20 74 |e can in|crease t|
|00003520| 68 65 20 70 65 72 66 6f | 72 6d 61 6e 63 65 20 6f |he perfo|rmance o|
|00003530| 66 20 63 65 72 74 61 69 | 6e 20 49 2f 4f 20 6f 70 |f certai|n I/O op|
|00003540| 65 72 61 74 69 6f 6e 73 | 2e 20 48 6f 77 65 76 65 |erations|. Howeve|
|00003550| 72 2c 20 69 74 20 64 6f | 65 73 20 6f 70 65 6e 20 |r, it do|es open |
|00003560| 61 20 77 69 6e 64 6f 77 | 20 6f 66 20 74 69 6d 65 |a window| of time|
|00003570| 20 77 68 65 72 65 20 64 | 61 74 61 20 63 61 6e 20 | where d|ata can |
|00003580| 62 65 20 6c 6f 73 74 20 | 69 66 20 61 20 73 79 73 |be lost |if a sys|
|00003590| 74 65 6d 20 63 72 61 73 | 68 65 73 2e 20 49 66 20 |tem cras|hes. If |
|000035a0| 74 68 65 20 73 79 73 74 | 65 6d 20 63 72 61 73 68 |the syst|em crash|
|000035b0| 65 73 20 77 68 65 6e 20 | 63 61 63 68 65 20 62 6c |es when |cache bl|
|000035c0| 6f 63 6b 73 20 68 6f 6c | 64 20 64 61 74 61 20 74 |ocks hol|d data t|
|000035d0| 68 61 74 20 68 61 73 6e | d5 74 20 62 65 65 6e 20 |hat hasn|.t been |
|000035e0| 66 6c 75 73 68 65 64 20 | 74 6f 20 64 69 73 6b 20 |flushed |to disk |
|000035f0| 28 64 69 72 74 79 20 62 | 6c 6f 63 6b 73 29 2c 20 |(dirty b|locks), |
|00003600| 74 68 65 20 64 61 74 61 | 20 69 6e 20 74 68 65 20 |the data| in the |
|00003610| 63 61 63 68 65 20 69 73 | 20 6c 6f 73 74 2e 20 54 |cache is| lost. T|
|00003620| 68 61 74 20 63 61 6e 20 | 63 61 75 73 65 20 6c 6f |hat can |cause lo|
|00003630| 73 74 20 66 69 6c 65 20 | 64 61 74 61 2c 20 6f 72 |st file |data, or|
|00003640| 20 63 61 6e 20 63 61 75 | 73 65 20 76 6f 6c 75 6d | can cau|se volum|
|00003650| 65 20 63 61 74 61 6c 6f | 67 20 63 6f 72 72 75 70 |e catalo|g corrup|
|00003660| 74 69 6f 6e 20 70 72 6f | 62 6c 65 6d 73 2e 0d 46 |tion pro|blems..F|
|00003670| 6c 75 73 68 69 6e 67 20 | 46 69 6c 65 73 20 61 6e |lushing |Files an|
|00003680| 64 20 56 6f 6c 75 6d 65 | 73 0d 54 68 65 20 46 69 |d Volume|s.The Fi|
|00003690| 6c 65 20 4d 61 6e 61 67 | 65 72 20 70 72 6f 76 69 |le Manag|er provi|
|000036a0| 64 65 73 20 72 6f 75 74 | 69 6e 65 73 20 79 6f 75 |des rout|ines you|
|000036b0| 20 63 61 6e 20 75 73 65 | 20 74 6f 20 66 6c 75 73 | can use| to flus|
|000036c0| 68 20 63 61 63 68 65 64 | 20 66 69 6c 65 20 61 6e |h cached| file an|
|000036d0| 64 20 76 6f 6c 75 6d 65 | 20 62 6c 6f 63 6b 73 20 |d volume| blocks |
|000036e0| 74 6f 20 64 69 73 6b 2e | 20 57 68 65 6e 20 61 20 |to disk.| When a |
|000036f0| 66 69 6c 65 20 6f 72 20 | 76 6f 6c 75 6d 65 20 69 |file or |volume i|
|00003700| 73 20 66 6c 75 73 68 65 | 64 2c 20 74 68 65 20 64 |s flushe|d, the d|
|00003710| 69 72 74 79 20 63 61 63 | 68 65 20 62 6c 6f 63 6b |irty cac|he block|
|00003720| 73 20 61 73 73 6f 63 69 | 61 74 65 64 20 77 69 74 |s associ|ated wit|
|00003730| 68 20 74 68 65 20 66 69 | 6c 65 20 6f 72 20 76 6f |h the fi|le or vo|
|00003740| 6c 75 6d 65 20 61 72 65 | 20 77 72 69 74 74 65 6e |lume are| written|
|00003750| 20 74 6f 20 64 69 73 6b | 2e 20 48 6f 77 65 76 65 | to disk|. Howeve|
|00003760| 72 2c 20 69 6e 64 69 73 | 63 72 69 6d 69 6e 61 74 |r, indis|criminat|
|00003770| 65 20 66 6c 75 73 68 69 | 6e 67 20 63 61 6e 20 61 |e flushi|ng can a|
|00003780| 66 66 65 63 74 20 70 65 | 72 66 6f 72 6d 61 6e 63 |ffect pe|rformanc|
|00003790| 65 2c 20 73 6f 20 61 6e | 20 75 6e 64 65 72 73 74 |e, so an| underst|
|000037a0| 61 6e 64 69 6e 67 20 6f | 66 20 77 68 61 74 20 74 |anding o|f what t|
|000037b0| 68 65 20 66 6c 75 73 68 | 20 63 61 6c 6c 73 20 61 |he flush| calls a|
|000037c0| 63 74 75 61 6c 6c 79 20 | 64 6f 20 69 73 20 61 6e |ctually |do is an|
|000037d0| 20 69 6d 70 6f 72 74 61 | 6e 74 20 70 61 72 74 20 | importa|nt part |
|000037e0| 6f 66 20 75 73 69 6e 67 | 20 74 68 65 20 66 6c 75 |of using| the flu|
|000037f0| 73 68 20 63 61 6c 6c 73 | 20 63 6f 72 72 65 63 74 |sh calls| correct|
|00003800| 6c 79 2e 0d 50 42 46 6c | 75 73 68 46 69 6c 65 20 |ly..PBFl|ushFile |
|00003810| 66 6c 75 73 68 65 73 20 | 61 6e 20 6f 70 65 6e 20 |flushes |an open |
|00003820| 66 69 6c 65 20 66 6f 72 | 6b d5 73 20 64 69 72 74 |file for|k.s dirt|
|00003830| 79 20 63 61 63 68 65 64 | 20 64 61 74 61 20 62 6c |y cached| data bl|
|00003840| 6f 63 6b 73 2c 20 62 75 | 74 20 6d 61 79 20 6e 6f |ocks, bu|t may no|
|00003850| 74 20 66 6c 75 73 68 20 | 63 61 74 61 6c 6f 67 20 |t flush |catalog |
|00003860| 69 6e 66 6f 72 6d 61 74 | 69 6f 6e 20 61 73 73 6f |informat|ion asso|
|00003870| 63 69 61 74 65 64 20 77 | 69 74 68 20 74 68 65 20 |ciated w|ith the |
|00003880| 66 69 6c 65 2e 20 54 6f | 20 65 6e 73 75 72 65 20 |file. To| ensure |
|00003890| 64 61 74 61 20 77 72 69 | 74 74 65 6e 20 74 6f 20 |data wri|tten to |
|000038a0| 61 20 66 69 6c 65 20 77 | 69 74 68 20 50 42 57 72 |a file w|ith PBWr|
|000038b0| 69 74 65 20 6f 72 20 46 | 53 57 72 69 74 65 20 69 |ite or F|SWrite i|
|000038c0| 73 20 66 6c 75 73 68 65 | 64 20 74 6f 20 74 68 65 |s flushe|d to the|
|000038d0| 20 76 6f 6c 75 6d 65 2c | 20 75 73 65 20 50 42 46 | volume,| use PBF|
|000038e0| 6c 75 73 68 46 69 6c 65 | 2e 0d 50 42 46 6c 75 73 |lushFile|..PBFlus|
|000038f0| 68 56 6f 6c 20 66 6c 75 | 73 68 65 73 20 61 6c 6c |hVol flu|shes all|
|00003900| 20 6f 70 65 6e 20 66 69 | 6c 65 73 20 6f 6e 20 74 | open fi|les on t|
|00003910| 68 65 20 76 6f 6c 75 6d | 65 2c 20 61 6e 64 20 74 |he volum|e, and t|
|00003920| 68 65 6e 2c 20 66 6c 75 | 73 68 65 73 20 61 6c 6c |hen, flu|shes all|
|00003930| 20 76 6f 6c 75 6d 65 20 | 64 61 74 61 20 73 74 72 | volume |data str|
|00003940| 75 63 74 75 72 65 73 2e | 20 53 6f 20 74 6f 20 65 |uctures.| So to e|
|00003950| 6e 73 75 72 65 20 61 6c | 6c 20 63 68 61 6e 67 65 |nsure al|l change|
|00003960| 73 20 74 6f 20 61 20 76 | 6f 6c 75 6d 65 2c 20 69 |s to a v|olume, i|
|00003970| 6e 63 6c 75 64 69 6e 67 | 20 74 68 65 20 76 6f 6c |ncluding| the vol|
|00003980| 75 6d 65 d5 73 20 63 61 | 74 61 6c 6f 67 20 61 6e |ume.s ca|talog an|
|00003990| 64 20 62 6c 6f 63 6b 20 | 61 6c 6c 6f 63 61 74 69 |d block |allocati|
|000039a0| 6f 6e 20 69 6e 66 6f 72 | 6d 61 74 69 6f 6e 2c 20 |on infor|mation, |
|000039b0| 61 72 65 20 66 6c 75 73 | 68 65 64 20 74 6f 20 74 |are flus|hed to t|
|000039c0| 68 65 20 76 6f 6c 75 6d | 65 2c 20 75 73 65 20 50 |he volum|e, use P|
|000039d0| 42 46 6c 75 73 68 56 6f | 6c 2e 20 0d 49 6e 20 61 |BFlushVo|l. .In a|
|000039e0| 64 64 69 74 69 6f 6e 20 | 74 6f 20 68 61 6e 64 6c |ddition |to handl|
|000039f0| 69 6e 67 20 74 6f 20 50 | 42 46 6c 75 73 68 46 69 |ing to P|BFlushFi|
|00003a00| 6c 65 20 61 6e 64 20 50 | 42 46 6c 75 73 68 56 6f |le and P|BFlushVo|
|00003a10| 6c 20 72 65 71 75 65 73 | 74 73 2c 20 74 68 65 20 |l reques|ts, the |
|00003a20| 66 69 6c 65 20 73 79 73 | 74 65 6d 20 66 6c 75 73 |file sys|tem flus|
|00003a30| 68 65 73 20 66 69 6c 65 | 73 20 61 6e 64 20 76 6f |hes file|s and vo|
|00003a40| 6c 75 6d 65 73 20 61 74 | 20 6f 74 68 65 72 20 74 |lumes at| other t|
|00003a50| 69 6d 65 73 3a 0d a5 09 | 57 68 65 6e 20 61 20 66 |imes:...|When a f|
|00003a60| 69 6c 65 20 66 6f 72 6b | 20 69 73 20 63 6c 6f 73 |ile fork| is clos|
|00003a70| 65 64 2c 20 74 68 65 20 | 66 69 6c 65 20 69 73 20 |ed, the |file is |
|00003a80| 66 69 72 73 74 20 66 6c | 75 73 68 65 64 20 61 6e |first fl|ushed an|
|00003a90| 64 20 74 68 65 6e 2c 20 | 61 6c 6c 20 63 61 63 68 |d then, |all cach|
|00003aa0| 65 20 62 6c 6f 63 6b 73 | 20 61 73 73 6f 63 69 61 |e blocks| associa|
|00003ab0| 74 65 64 20 77 69 74 68 | 20 74 68 65 20 66 69 6c |ted with| the fil|
|00003ac0| 65 20 61 72 65 20 72 65 | 6d 6f 76 65 64 20 66 72 |e are re|moved fr|
|00003ad0| 6f 6d 20 74 68 65 20 63 | 61 63 68 65 2e 20 59 6f |om the c|ache. Yo|
|00003ae0| 75 20 64 6f 6e d5 74 20 | 6e 65 65 64 20 74 6f 20 |u don.t |need to |
|00003af0| 66 6c 75 73 68 20 61 20 | 66 69 6c 65 20 62 65 66 |flush a |file bef|
|00003b00| 6f 72 65 20 63 6c 6f 73 | 69 6e 67 20 69 74 2e 0d |ore clos|ing it..|
|00003b10| a5 09 57 68 65 6e 20 61 | 20 76 6f 6c 75 6d 65 20 |..When a| volume |
|00003b20| 69 73 20 75 6e 6d 6f 75 | 6e 74 65 64 2c 20 65 6a |is unmou|nted, ej|
|00003b30| 65 63 74 65 64 2c 20 6f | 72 20 70 75 74 20 6f 66 |ected, o|r put of|
|00003b40| 66 6c 69 6e 65 2c 20 74 | 68 65 20 76 6f 6c 75 6d |fline, t|he volum|
|00003b50| 65 20 69 73 20 66 69 72 | 73 74 20 66 6c 75 73 68 |e is fir|st flush|
|00003b60| 65 64 20 61 6e 64 20 74 | 68 65 6e 2c 20 61 6c 6c |ed and t|hen, all|
|00003b70| 20 63 61 63 68 65 20 62 | 6c 6f 63 6b 73 20 61 73 | cache b|locks as|
|00003b80| 73 6f 63 69 61 74 65 64 | 20 77 69 74 68 20 74 68 |sociated| with th|
|00003b90| 65 20 76 6f 6c 75 6d 65 | 20 61 72 65 20 72 65 6d |e volume| are rem|
|00003ba0| 6f 76 65 64 20 66 72 6f | 6d 20 74 68 65 20 63 61 |oved fro|m the ca|
|00003bb0| 63 68 65 2e 20 59 6f 75 | 20 64 6f 6e d5 74 20 6e |che. You| don.t n|
|00003bc0| 65 65 64 20 74 6f 20 66 | 6c 75 73 68 20 61 20 76 |eed to f|lush a v|
|00003bd0| 6f 6c 75 6d 65 20 62 65 | 66 6f 72 65 20 75 6e 6d |olume be|fore unm|
|00003be0| 6f 75 6e 74 69 6e 67 20 | 69 74 2c 20 65 6a 65 63 |ounting |it, ejec|
|00003bf0| 74 69 6e 67 20 69 74 2c | 20 6f 72 20 70 75 74 74 |ting it,| or putt|
|00003c00| 69 6e 67 20 69 74 20 6f | 66 66 6c 69 6e 65 2e 0d |ing it o|ffline..|
|00003c10| 46 69 6c 65 20 42 6c 6f | 63 6b 20 50 72 65 61 6c |File Blo|ck Preal|
|00003c20| 6c 6f 63 61 74 69 6f 6e | 0d 50 72 65 61 6c 6c 6f |location|.Preallo|
|00003c30| 63 61 74 69 6e 67 20 74 | 68 65 20 73 70 61 63 65 |cating t|he space|
|00003c40| 20 66 6f 72 20 61 20 66 | 69 6c 65 20 63 61 6e 20 | for a f|ile can |
|00003c50| 6b 65 65 70 20 74 68 65 | 20 66 69 6c 65 20 61 6e |keep the| file an|
|00003c60| 64 20 74 68 65 20 76 6f | 6c 75 6d 65 20 66 72 6f |d the vo|lume fro|
|00003c70| 6d 20 62 65 69 6e 67 20 | 66 72 61 67 6d 65 6e 74 |m being |fragment|
|00003c80| 65 64 2e 20 41 63 63 65 | 73 73 69 6e 67 20 74 68 |ed. Acce|ssing th|
|00003c90| 65 20 64 61 74 61 20 69 | 6e 20 61 6e 20 75 6e 66 |e data i|n an unf|
|00003ca0| 72 61 67 6d 65 6e 74 65 | 64 20 66 69 6c 65 20 63 |ragmente|d file c|
|00003cb0| 61 6e 20 62 65 20 66 61 | 73 74 65 72 2e 20 54 68 |an be fa|ster. Th|
|00003cc0| 65 20 46 69 6c 65 20 4d | 61 6e 61 67 65 72 d5 73 |e File M|anager.s|
|00003cd0| 20 41 6c 6c 6f 63 61 74 | 65 20 61 6e 64 20 41 6c | Allocat|e and Al|
|00003ce0| 6c 6f 63 43 6f 6e 74 69 | 67 20 66 75 6e 63 74 69 |locConti|g functi|
|00003cf0| 6f 6e 73 20 61 6c 6c 6f | 77 20 79 6f 75 20 74 6f |ons allo|w you to|
|00003d00| 20 61 6c 6c 6f 63 61 74 | 65 20 61 64 64 69 74 69 | allocat|e additi|
|00003d10| 6f 6e 61 6c 20 73 70 61 | 63 65 20 74 6f 20 61 6e |onal spa|ce to an|
|00003d20| 20 6f 70 65 6e 20 66 69 | 6c 65 2e 20 48 6f 77 65 | open fi|le. Howe|
|00003d30| 76 65 72 2c 20 74 68 65 | 72 65 20 61 72 65 20 74 |ver, the|re are t|
|00003d40| 77 6f 20 69 6d 70 6f 72 | 74 61 6e 74 20 70 6f 69 |wo impor|tant poi|
|00003d50| 6e 74 73 20 74 6f 20 6e | 6f 74 65 3a 0d a5 09 54 |nts to n|ote:...T|
|00003d60| 68 65 20 73 70 61 63 65 | 20 61 6c 6c 6f 63 61 74 |he space| allocat|
|00003d70| 65 64 20 77 69 74 68 20 | 41 6c 6c 6f 63 61 74 65 |ed with |Allocate|
|00003d80| 20 6f 72 20 41 6c 6c 6f | 63 43 6f 6e 74 69 67 20 | or Allo|cContig |
|00003d90| 69 73 20 6e 6f 74 20 70 | 65 72 6d 61 6e 65 6e 74 |is not p|ermanent|
|00003da0| 6c 79 20 61 73 73 69 67 | 6e 65 64 20 74 6f 20 74 |ly assig|ned to t|
|00003db0| 68 61 74 20 66 69 6c 65 | 20 75 6e 74 69 6c 20 74 |hat file| until t|
|00003dc0| 68 65 20 66 69 6c 65 d5 | 73 20 6c 6f 67 69 63 61 |he file.|s logica|
|00003dd0| 6c 20 45 4f 46 20 69 73 | 20 63 68 61 6e 67 65 64 |l EOF is| changed|
|00003de0| 20 74 6f 20 69 6e 63 6c | 75 64 65 20 74 68 65 20 | to incl|ude the |
|00003df0| 61 6c 6c 6f 63 61 74 65 | 64 20 73 70 61 63 65 2e |allocate|d space.|
|00003e00| 20 59 6f 75 20 63 61 6e | 20 75 73 65 20 53 65 74 | You can| use Set|
|00003e10| 45 4f 46 20 74 6f 20 63 | 68 61 6e 67 65 20 74 68 |EOF to c|hange th|
|00003e20| 65 20 66 69 6c 65 d5 73 | 20 6c 6f 67 69 63 61 6c |e file.s| logical|
|00003e30| 20 45 4f 46 20 74 6f 20 | 69 6e 63 6c 75 64 65 20 | EOF to |include |
|00003e40| 74 68 65 20 61 6c 6c 6f | 63 61 74 65 64 20 73 70 |the allo|cated sp|
|00003e50| 61 63 65 2e 20 57 68 65 | 6e 20 61 20 66 69 6c 65 |ace. Whe|n a file|
|00003e60| 20 28 6f 72 20 76 6f 6c | 75 6d 65 29 20 69 73 20 | (or vol|ume) is |
|00003e70| 66 6c 75 73 68 65 64 20 | 6f 72 20 63 6c 6f 73 65 |flushed |or close|
|00003e80| 64 2c 20 74 68 65 20 73 | 70 61 63 65 20 62 65 79 |d, the s|pace bey|
|00003e90| 6f 6e 64 20 74 68 65 20 | 66 69 6c 65 d5 73 20 6c |ond the |file.s l|
|00003ea0| 6f 67 69 63 61 6c 20 45 | 4f 46 20 69 73 20 6d 61 |ogical E|OF is ma|
|00003eb0| 64 65 20 61 76 61 69 6c | 61 62 6c 65 20 66 6f 72 |de avail|able for|
|00003ec0| 20 6f 74 68 65 72 20 70 | 75 72 70 6f 73 65 73 2e | other p|urposes.|
|00003ed0| 0d a5 09 41 6c 6c 6f 63 | 61 74 65 20 61 6e 64 20 |...Alloc|ate and |
|00003ee0| 41 6c 6c 6f 63 43 6f 6e | 74 69 67 20 61 72 65 20 |AllocCon|tig are |
|00003ef0| 6e 6f 74 20 73 75 70 70 | 6f 72 74 65 64 20 62 79 |not supp|orted by|
|00003f00| 20 61 6c 6c 20 66 69 6c | 65 20 73 79 73 74 65 6d | all fil|e system|
|00003f10| 73 2e 20 46 6f 72 20 65 | 78 61 6d 70 6c 65 2c 20 |s. For e|xample, |
|00003f20| 72 65 6d 6f 74 65 20 76 | 6f 6c 75 6d 65 73 20 6d |remote v|olumes m|
|00003f30| 6f 75 6e 74 65 64 20 62 | 79 20 74 68 65 20 41 70 |ounted b|y the Ap|
|00003f40| 70 6c 65 53 68 61 72 65 | 20 66 69 6c 65 20 73 79 |pleShare| file sy|
|00003f50| 73 74 65 6d 20 64 6f 20 | 6e 6f 74 20 73 75 70 70 |stem do |not supp|
|00003f60| 6f 72 74 20 41 6c 6c 6f | 63 61 74 65 20 61 6e 64 |ort Allo|cate and|
|00003f70| 20 41 6c 6c 6f 63 43 6f | 6e 74 69 67 2e 20 54 6f | AllocCo|ntig. To|
|00003f80| 20 61 6c 6c 6f 63 61 74 | 65 20 73 70 61 63 65 20 | allocat|e space |
|00003f90| 66 6f 72 20 61 20 66 69 | 6c 65 20 6f 6e 20 61 6e |for a fi|le on an|
|00003fa0| 79 20 76 6f 6c 75 6d 65 | 2c 20 75 73 65 20 53 65 |y volume|, use Se|
|00003fb0| 74 45 4f 46 2e 0d 41 20 | 53 69 6d 70 6c 65 20 45 |tEOF..A |Simple E|
|00003fc0| 78 61 6d 70 6c 65 20 6f | 66 20 42 61 6c 61 6e 63 |xample o|f Balanc|
|00003fd0| 69 6e 67 20 43 61 63 68 | 65 64 20 49 2f 4f 20 50 |ing Cach|ed I/O P|
|00003fe0| 65 72 66 6f 72 6d 61 6e | 63 65 20 61 6e 64 20 44 |erforman|ce and D|
|00003ff0| 61 74 61 20 49 6e 74 65 | 67 72 69 74 79 0d 47 69 |ata Inte|grity.Gi|
|00004000| 76 65 6e 20 74 68 65 20 | 69 6e 66 6f 72 6d 61 74 |ven the |informat|
|00004010| 69 6f 6e 20 6a 75 73 74 | 20 70 72 6f 76 69 64 65 |ion just| provide|
|00004020| 64 2c 20 79 6f 75 20 73 | 68 6f 75 6c 64 20 62 65 |d, you s|hould be|
|00004030| 20 61 62 6c 65 20 74 6f | 20 75 73 65 20 74 68 65 | able to| use the|
|00004040| 20 66 6c 75 73 68 20 63 | 61 6c 6c 73 20 61 6c 6f | flush c|alls alo|
|00004050| 6e 67 20 77 69 74 68 20 | 70 72 65 61 6c 6c 6f 63 |ng with |prealloc|
|00004060| 61 74 69 6e 67 20 73 70 | 61 63 65 20 66 6f 72 20 |ating sp|ace for |
|00004070| 79 6f 75 72 20 66 69 6c | 65 20 74 6f 20 65 6e 73 |your fil|e to ens|
|00004080| 75 72 65 20 74 68 61 74 | 20 79 6f 75 72 20 64 61 |ure that| your da|
|00004090| 74 61 20 69 73 20 73 61 | 66 65 6c 79 20 6f 6e 20 |ta is sa|fely on |
|000040a0| 61 20 64 69 73 6b 20 77 | 69 74 68 6f 75 74 20 69 |a disk w|ithout i|
|000040b0| 6e 63 75 72 72 69 6e 67 | 20 70 65 72 66 6f 72 6d |ncurring| perform|
|000040c0| 61 6e 63 65 20 70 65 6e | 61 6c 74 69 65 73 20 64 |ance pen|alties d|
|000040d0| 75 72 69 6e 67 20 79 6f | 75 72 20 49 2f 4f 20 6f |uring yo|ur I/O o|
|000040e0| 70 65 72 61 74 69 6f 6e | 73 2e 20 48 6f 77 65 76 |peration|s. Howev|
|000040f0| 65 72 2c 20 61 20 73 6d | 61 6c 6c 20 63 6f 6d 6d |er, a sm|all comm|
|00004100| 65 6e 74 65 64 20 65 78 | 61 6d 70 6c 65 20 63 61 |ented ex|ample ca|
|00004110| 6e d5 74 20 68 75 72 74 | 2c 20 73 6f c9 0d 65 6e |n.t hurt|, so..en|
|00004120| 75 6d 0d 7b 0d 20 20 20 | 20 2f 2a 0d 20 20 20 20 |um.{. | /*. |
|00004130| 2a 2a 20 20 53 65 74 20 | 6b 4d 61 78 57 72 69 74 |** Set |kMaxWrit|
|00004140| 65 20 74 6f 20 74 68 65 | 20 6c 61 72 67 65 73 74 |e to the| largest|
|00004150| 20 61 6d 6f 75 6e 74 20 | 6f 66 20 64 61 74 61 20 | amount |of data |
|00004160| 79 6f 75 72 20 77 72 69 | 74 65 20 70 72 6f 63 20 |your wri|te proc |
|00004170| 77 69 6c 6c 0d 20 20 20 | 20 2a 2a 20 20 77 72 69 |will. | ** wri|
|00004180| 74 65 20 69 6e 20 6f 6e | 65 20 63 61 6c 6c 2e 20 |te in on|e call. |
|00004190| 54 68 65 6e 2c 20 73 65 | 74 20 6b 4d 69 6e 57 72 |Then, se|t kMinWr|
|000041a0| 69 74 65 73 50 65 72 41 | 6c 6c 6f 63 61 74 65 20 |itesPerA|llocate |
|000041b0| 74 6f 20 74 68 65 20 6d | 69 6e 69 6d 75 6d 0d 20 |to the m|inimum. |
|000041c0| 20 20 20 2a 2a 20 20 6e | 75 6d 62 65 72 20 6f 66 | ** n|umber of|
|000041d0| 20 77 72 69 74 65 73 20 | 79 6f 75 20 77 61 6e 74 | writes |you want|
|000041e0| 20 62 65 66 6f 72 65 20 | 6d 6f 72 65 20 73 70 61 | before |more spa|
|000041f0| 63 65 20 69 73 20 61 6c | 6c 6f 63 61 74 65 64 2e |ce is al|located.|
|00004200| 0d 20 20 20 20 2a 2f 0d | 20 20 20 20 6b 4d 61 78 |. */.| kMax|
|00004210| 57 72 69 74 65 20 20 20 | 20 20 20 20 20 20 20 20 |Write | |
|00004220| 20 20 3d 20 30 78 31 30 | 30 30 30 2c 0d 20 20 20 | = 0x10|000,. |
|00004230| 20 6b 4d 69 6e 57 72 69 | 74 65 73 50 65 72 41 6c | kMinWri|tesPerAl|
|00004240| 6c 6f 63 61 74 65 20 3d | 20 34 0d 7d 3b 0d 2f 2a |locate =| 4.};./*|
|00004250| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004260| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004270| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004280| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004290| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2f 0d 2f 2a |********|****/./*|
|000042a0| 0d 2a 2a 20 20 20 20 50 | 72 6f 74 6f 74 79 70 65 |.** P|rototype|
|000042b0| 20 66 6f 72 20 74 68 65 | 20 72 6f 75 74 69 6e 65 | for the| routine|
|000042c0| 20 74 68 61 74 20 77 72 | 69 74 65 73 20 64 61 74 | that wr|ites dat|
|000042d0| 61 20 74 6f 20 61 20 66 | 69 6c 65 2e 0d 2a 2a 20 |a to a f|ile..** |
|000042e0| 20 20 20 59 6f 75 72 20 | 77 72 69 74 65 20 70 72 | Your |write pr|
|000042f0| 6f 63 65 64 75 72 65 20 | 63 61 6e 20 6d 61 6b 65 |ocedure |can make|
|00004300| 20 73 75 72 65 20 64 61 | 74 61 20 69 73 20 72 65 | sure da|ta is re|
|00004310| 61 6c 6c 79 20 77 72 69 | 74 74 65 6e 20 74 6f 20 |ally wri|tten to |
|00004320| 64 69 73 6b 20 62 79 0d | 2a 2a 20 20 20 20 63 61 |disk by.|** ca|
|00004330| 6c 6c 69 6e 67 20 50 42 | 46 6c 75 73 68 46 69 6c |lling PB|FlushFil|
|00004340| 65 2c 20 6f 72 20 79 6f | 75 20 63 61 6e 20 62 6c |e, or yo|u can bl|
|00004350| 6f 63 6b 2d 61 6c 69 67 | 6e 20 79 6f 75 72 20 72 |ock-alig|n your r|
|00004360| 65 71 75 65 73 74 73 20 | 61 6e 64 20 73 65 74 20 |equests |and set |
|00004370| 74 68 65 0d 2a 2a 20 20 | 20 20 6e 6f 43 61 63 68 |the.** | noCach|
|00004380| 65 20 69 6f 50 6f 73 4d | 6f 64 65 20 62 69 74 20 |e ioPosM|ode bit |
|00004390| 69 6e 20 79 6f 75 72 20 | 63 61 6c 6c 73 20 74 6f |in your |calls to|
|000043a0| 20 50 42 57 72 69 74 65 | 20 28 77 69 74 68 20 74 | PBWrite| (with t|
|000043b0| 68 65 20 48 46 53 20 66 | 69 6c 65 20 73 79 73 74 |he HFS f|ile syst|
|000043c0| 65 6d 2c 0d 2a 2a 20 20 | 20 20 62 6c 6f 63 6b 2d |em,.** | block-|
|000043d0| 61 6c 69 67 6e 65 64 20 | 72 65 71 75 65 73 74 73 |aligned |requests|
|000043e0| 20 77 69 74 68 20 74 68 | 65 20 6e 6f 43 61 63 68 | with th|e noCach|
|000043f0| 65 20 62 69 74 20 73 65 | 74 20 61 72 65 20 6e 6f |e bit se|t are no|
|00004400| 74 20 63 61 63 68 65 64 | 29 2e 0d 2a 2f 0d 74 79 |t cached|)..*/.ty|
|00004410| 70 65 64 65 66 20 70 61 | 73 63 61 6c 20 4f 53 45 |pedef pa|scal OSE|
|00004420| 72 72 20 28 2a 57 72 69 | 74 65 50 72 6f 63 50 74 |rr (*Wri|teProcPt|
|00004430| 72 29 20 28 73 68 6f 72 | 74 20 72 65 66 4e 75 6d |r) (shor|t refNum|
|00004440| 2c 20 42 6f 6f 6c 65 61 | 6e 20 2a 64 6f 6e 65 57 |, Boolea|n *doneW|
|00004450| 72 69 74 69 6e 67 2c 0d | 20 20 20 20 20 20 20 20 |riting,.| |
|00004460| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004470| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 76 6f | | vo|
|00004480| 69 64 20 2a 79 6f 75 72 | 44 61 74 61 50 74 72 29 |id *your|DataPtr)|
|00004490| 3b 0d 2f 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |;./*****|********|
|000044a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000044b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000044c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000044d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000044e0| 2f 0d 2f 2a 0d 2a 2a 20 | 20 20 20 4d 6f 72 65 53 |/./*.** | MoreS|
|000044f0| 70 61 63 65 20 63 68 65 | 63 6b 73 20 74 6f 20 73 |pace che|cks to s|
|00004500| 65 65 20 69 66 20 6d 6f | 72 65 20 73 70 61 63 65 |ee if mo|re space|
|00004510| 20 73 68 6f 75 6c 64 20 | 62 65 20 61 6c 6c 6f 63 | should |be alloc|
|00004520| 61 74 65 64 20 74 6f 20 | 61 6e 0d 2a 2a 20 20 20 |ated to |an.** |
|00004530| 20 6f 70 65 6e 20 66 69 | 6c 65 20 62 61 73 65 64 | open fi|le based|
|00004540| 20 6f 6e 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 | on the |current |
|00004550| 70 6f 73 69 74 69 6f 6e | 20 61 6e 64 20 74 68 65 |position| and the|
|00004560| 20 63 75 72 72 65 6e 74 | 20 45 4f 46 20 61 6e 64 | current| EOF and|
|00004570| 0d 2a 2a 20 20 20 20 69 | 66 20 73 6f 2c 20 74 68 |.** i|f so, th|
|00004580| 65 6e 20 61 6c 6c 6f 63 | 61 74 65 73 20 74 68 65 |en alloc|ates the|
|00004590| 20 73 70 61 63 65 20 62 | 79 20 65 78 74 65 6e 64 | space b|y extend|
|000045a0| 69 6e 67 20 74 68 65 20 | 45 4f 46 2e 0d 2a 2a 20 |ing the |EOF..** |
|000045b0| 20 20 20 49 66 20 6d 6f | 72 65 20 73 70 61 63 65 | If mo|re space|
|000045c0| 20 69 73 20 61 6c 6c 6f | 63 61 74 65 64 2c 20 74 | is allo|cated, t|
|000045d0| 68 65 20 76 6f 6c 75 6d | 65 20 69 73 20 66 6c 75 |he volum|e is flu|
|000045e0| 73 68 65 64 20 74 6f 20 | 65 6e 73 75 72 65 0d 2a |shed to |ensure.*|
|000045f0| 2a 20 20 20 20 74 68 65 | 20 61 64 64 69 74 69 6f |* the| additio|
|00004600| 6e 61 6c 20 73 70 61 63 | 65 20 69 73 20 72 65 63 |nal spac|e is rec|
|00004610| 6f 72 64 65 64 20 69 6e | 20 74 68 65 20 63 61 74 |orded in| the cat|
|00004620| 61 6c 6f 67 20 66 69 6c | 65 20 6f 6e 20 64 69 73 |alog fil|e on dis|
|00004630| 6b 2e 0d 2a 2f 0d 4f 53 | 45 72 72 20 20 20 20 4d |k..*/.OS|Err M|
|00004640| 6f 72 65 53 70 61 63 65 | 28 73 68 6f 72 74 20 20 |oreSpace|(short |
|00004650| 20 20 72 65 66 4e 75 6d | 2c 20 73 68 6f 72 74 20 | refNum|, short |
|00004660| 76 52 65 66 4e 75 6d 29 | 0d 7b 0d 20 20 20 20 4f |vRefNum)|.{. O|
|00004670| 53 45 72 72 20 20 20 20 | 72 65 73 75 6c 74 3b 0d |SErr |result;.|
|00004680| 20 20 20 20 6c 6f 6e 67 | 20 20 20 20 66 69 6c 65 | long| file|
|00004690| 50 6f 73 2c 20 6c 6f 67 | 45 4f 46 3b 0d 20 20 20 |Pos, log|EOF;. |
|000046a0| 20 0d 20 20 20 20 72 65 | 73 75 6c 74 20 3d 20 47 | . re|sult = G|
|000046b0| 65 74 46 50 6f 73 28 72 | 65 66 4e 75 6d 2c 20 26 |etFPos(r|efNum, &|
|000046c0| 66 69 6c 65 50 6f 73 29 | 3b 0d 20 20 20 20 69 66 |filePos)|;. if|
|000046d0| 20 28 20 72 65 73 75 6c | 74 20 3d 3d 20 6e 6f 45 | ( resul|t == noE|
|000046e0| 72 72 20 29 0d 20 20 20 | 20 7b 0d 20 20 20 20 20 |rr ). | {. |
|000046f0| 20 20 20 72 65 73 75 6c | 74 20 3d 20 47 65 74 45 | resul|t = GetE|
|00004700| 4f 46 28 72 65 66 4e 75 | 6d 2c 20 26 6c 6f 67 45 |OF(refNu|m, &logE|
|00004710| 4f 46 29 3b 0d 20 20 20 | 20 20 20 20 20 69 66 20 |OF);. | if |
|00004720| 28 20 28 72 65 73 75 6c | 74 20 3d 3d 20 6e 6f 45 |( (resul|t == noE|
|00004730| 72 72 29 20 26 26 20 28 | 28 6c 6f 67 45 4f 46 20 |rr) && (|(logEOF |
|00004740| 2d 20 66 69 6c 65 50 6f | 73 29 20 3c 3d 20 6b 4d |- filePo|s) <= kM|
|00004750| 61 78 57 72 69 74 65 29 | 20 29 0d 20 20 20 20 20 |axWrite)| ). |
|00004760| 20 20 20 7b 0d 20 20 20 | 20 20 20 20 20 20 20 20 | {. | |
|00004770| 20 72 65 73 75 6c 74 20 | 3d 20 53 65 74 45 4f 46 | result |= SetEOF|
|00004780| 28 72 65 66 4e 75 6d 2c | 20 6c 6f 67 45 4f 46 20 |(refNum,| logEOF |
|00004790| 2b 20 28 6b 4d 61 78 57 | 72 69 74 65 20 2a 20 6b |+ (kMaxW|rite * k|
|000047a0| 4d 69 6e 57 72 69 74 65 | 73 50 65 72 41 6c 6c 6f |MinWrite|sPerAllo|
|000047b0| 63 61 74 65 29 29 3b 0d | 20 20 20 20 20 20 20 20 |cate));.| |
|000047c0| 20 20 20 20 69 66 20 28 | 20 72 65 73 75 6c 74 20 | if (| result |
|000047d0| 3d 3d 20 6e 6f 45 72 72 | 20 29 0d 20 20 20 20 20 |== noErr| ). |
|000047e0| 20 20 20 20 20 20 20 7b | 0d 20 20 20 20 20 20 20 | {|. |
|000047f0| 20 20 20 20 20 20 20 20 | 20 72 65 73 75 6c 74 20 | | result |
|00004800| 3d 20 46 6c 75 73 68 56 | 6f 6c 28 4e 55 4c 4c 2c |= FlushV|ol(NULL,|
|00004810| 20 76 52 65 66 4e 75 6d | 29 3b 0d 20 20 20 20 20 | vRefNum|);. |
|00004820| 20 20 20 20 20 20 20 7d | 0d 20 20 20 20 20 20 20 | }|. |
|00004830| 20 7d 0d 20 20 20 20 7d | 0d 20 20 20 20 72 65 74 | }. }|. ret|
|00004840| 75 72 6e 20 28 20 72 65 | 73 75 6c 74 20 29 3b 0d |urn ( re|sult );.|
|00004850| 7d 0d 2f 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |}./*****|********|
|00004860| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004870| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004880| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004890| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000048a0| 2f 0d 2f 2a 0d 2a 2a 20 | 20 20 20 53 69 6d 70 6c |/./*.** | Simpl|
|000048b0| 65 20 65 78 61 6d 70 6c | 65 20 6f 66 20 63 72 65 |e exampl|e of cre|
|000048c0| 61 74 69 6e 67 20 61 6e | 64 20 77 72 69 74 69 6e |ating an|d writin|
|000048d0| 67 20 74 6f 20 61 20 66 | 69 6c 65 2e 0d 2a 2f 0d |g to a f|ile..*/.|
|000048e0| 4f 53 45 72 72 20 20 20 | 20 53 61 66 65 57 72 69 |OSErr | SafeWri|
|000048f0| 74 65 46 69 6c 65 28 63 | 6f 6e 73 74 20 57 72 69 |teFile(c|onst Wri|
|00004900| 74 65 50 72 6f 63 50 74 | 72 20 77 72 69 74 65 50 |teProcPt|r writeP|
|00004910| 72 6f 63 2c 20 76 6f 69 | 64 20 2a 79 6f 75 72 44 |roc, voi|d *yourD|
|00004920| 61 74 61 50 74 72 29 0d | 7b 0d 20 20 20 20 4f 53 |ataPtr).|{. OS|
|00004930| 45 72 72 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |Err | |
|00004940| 20 72 65 73 75 6c 74 3b | 0d 20 20 20 20 53 74 72 | result;|. Str|
|00004950| 32 35 35 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |255 | |
|00004960| 70 72 6f 6d 70 74 20 20 | 20 20 20 20 20 3d 20 22 |prompt | = "|
|00004970| 5c 70 53 61 76 65 20 74 | 68 69 73 20 64 6f 63 75 |\pSave t|his docu|
|00004980| 6d 65 6e 74 20 61 73 3a | 22 3b 0d 20 20 20 20 53 |ment as:|";. S|
|00004990| 74 72 32 35 35 20 20 20 | 20 20 20 20 20 20 20 20 |tr255 | |
|000049a0| 20 20 64 65 66 61 75 6c | 74 4e 61 6d 65 20 20 3d | defaul|tName =|
|000049b0| 20 22 5c 70 75 6e 74 69 | 74 6c 65 64 22 3b 0d 20 | "\punti|tled";. |
|000049c0| 20 20 20 53 74 61 6e 64 | 61 72 64 46 69 6c 65 52 | Stand|ardFileR|
|000049d0| 65 70 6c 79 20 20 72 65 | 70 6c 79 3b 0d 20 20 20 |eply re|ply;. |
|000049e0| 20 4f 53 54 79 70 65 20 | 20 20 20 20 20 20 20 20 | OSType | |
|000049f0| 20 20 20 20 63 72 65 61 | 74 6f 72 20 20 20 20 20 | crea|tor |
|00004a00| 20 3d 20 27 3f 3f 3f 3f | 27 3b 0d 20 20 20 20 4f | = '????|';. O|
|00004a10| 53 54 79 70 65 20 20 20 | 20 20 20 20 20 20 20 20 |SType | |
|00004a20| 20 20 66 69 6c 65 54 79 | 70 65 20 20 20 20 20 3d | fileTy|pe =|
|00004a30| 20 27 54 45 58 54 27 3b | 0d 20 20 20 20 73 68 6f | 'TEXT';|. sho|
|00004a40| 72 74 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |rt | |
|00004a50| 72 65 66 4e 75 6d 3b 0d | 20 20 20 20 42 6f 6f 6c |refNum;.| Bool|
|00004a60| 65 61 6e 20 20 20 20 20 | 20 20 20 20 20 20 20 64 |ean | d|
|00004a70| 6f 6e 65 57 72 69 74 69 | 6e 67 3b 0d 20 20 20 20 |oneWriti|ng;. |
|00004a80| 6c 6f 6e 67 20 20 20 20 | 20 20 20 20 20 20 20 20 |long | |
|00004a90| 20 20 20 66 69 6c 65 50 | 6f 73 3b 0d 20 20 20 20 | fileP|os;. |
|00004aa0| 0d 20 20 20 20 53 74 61 | 6e 64 61 72 64 50 75 74 |. Sta|ndardPut|
|00004ab0| 46 69 6c 65 20 28 70 72 | 6f 6d 70 74 2c 20 64 65 |File (pr|ompt, de|
|00004ac0| 66 61 75 6c 74 4e 61 6d | 65 2c 26 20 72 65 70 6c |faultNam|e,& repl|
|00004ad0| 79 29 3b 0d 20 20 20 20 | 69 66 20 28 20 72 65 70 |y);. |if ( rep|
|00004ae0| 6c 79 2e 73 66 47 6f 6f | 64 20 29 0d 20 20 20 20 |ly.sfGoo|d ). |
|00004af0| 7b 0d 20 20 20 20 20 20 | 20 20 69 66 20 28 20 72 |{. | if ( r|
|00004b00| 65 70 6c 79 2e 73 66 52 | 65 70 6c 61 63 69 6e 67 |eply.sfR|eplacing|
|00004b10| 20 29 0d 20 20 20 20 20 | 20 20 20 7b 0d 20 20 20 | ). | {. |
|00004b20| 20 20 20 20 20 20 20 20 | 20 2f 2a 20 44 65 6c 65 | | /* Dele|
|00004b30| 74 65 20 6f 6c 64 20 66 | 69 6c 65 20 2a 2f 0d 20 |te old f|ile */. |
|00004b40| 20 20 20 20 20 20 20 20 | 20 20 20 28 76 6f 69 64 | | (void|
|00004b50| 29 20 46 53 70 44 65 6c | 65 74 65 28 26 72 65 70 |) FSpDel|ete(&rep|
|00004b60| 6c 79 2e 73 66 46 69 6c | 65 29 3b 0d 20 20 20 20 |ly.sfFil|e);. |
|00004b70| 20 20 20 20 7d 0d 20 20 | 20 20 20 20 20 20 0d 20 | }. | . |
|00004b80| 20 20 20 20 20 20 20 72 | 65 73 75 6c 74 20 3d 20 | r|esult = |
|00004b90| 46 53 70 43 72 65 61 74 | 65 28 26 72 65 70 6c 79 |FSpCreat|e(&reply|
|00004ba0| 2e 73 66 46 69 6c 65 2c | 20 63 72 65 61 74 6f 72 |.sfFile,| creator|
|00004bb0| 2c 20 66 69 6c 65 54 79 | 70 65 2c 20 72 65 70 6c |, fileTy|pe, repl|
|00004bc0| 79 2e 73 66 53 63 72 69 | 70 74 29 3b 0d 20 20 20 |y.sfScri|pt);. |
|00004bd0| 20 20 20 20 20 69 66 20 | 28 20 72 65 73 75 6c 74 | if |( result|
|00004be0| 20 3d 3d 20 6e 6f 45 72 | 72 20 29 0d 20 20 20 20 | == noEr|r ). |
|00004bf0| 20 20 20 20 7b 0d 20 20 | 20 20 20 20 20 20 20 20 | {. | |
|00004c00| 20 20 72 65 73 75 6c 74 | 20 3d 20 46 53 70 4f 70 | result| = FSpOp|
|00004c10| 65 6e 44 46 28 26 72 65 | 70 6c 79 2e 73 66 46 69 |enDF(&re|ply.sfFi|
|00004c20| 6c 65 2c 20 66 73 52 64 | 57 72 50 65 72 6d 2c 20 |le, fsRd|WrPerm, |
|00004c30| 26 72 65 66 4e 75 6d 29 | 3b 0d 20 20 20 20 20 20 |&refNum)|;. |
|00004c40| 20 20 20 20 20 20 69 66 | 20 28 20 72 65 73 75 6c | if| ( resul|
|00004c50| 74 20 3d 3d 20 6e 6f 45 | 72 72 20 29 0d 20 20 20 |t == noE|rr ). |
|00004c60| 20 20 20 20 20 20 20 20 | 20 7b 0d 20 20 20 20 20 | | {. |
|00004c70| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2a 0d 20 20 | | /*. |
|00004c80| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2a 2a | | **|
|00004c90| 20 20 20 20 50 72 65 61 | 6c 6c 6f 63 61 74 65 20 | Prea|llocate |
|00004ca0| 73 6f 6d 65 20 73 70 61 | 63 65 20 61 6e 64 20 66 |some spa|ce and f|
|00004cb0| 6c 75 73 68 20 74 68 65 | 20 76 6f 6c 75 6d 65 2e |lush the| volume.|
|00004cc0| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00004cd0| 20 2a 2a 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 | **. | |
|00004ce0| 20 20 20 20 2a 2a 20 20 | 20 20 46 6c 75 73 68 69 | ** | Flushi|
|00004cf0| 6e 67 20 74 68 65 20 76 | 6f 6c 75 6d 65 20 68 65 |ng the v|olume he|
|00004d00| 72 65 20 6d 61 6b 65 73 | 20 73 75 72 65 20 74 68 |re makes| sure th|
|00004d10| 65 20 6e 65 77 6c 79 0d | 20 20 20 20 20 20 20 20 |e newly.| |
|00004d20| 20 20 20 20 20 20 20 20 | 2a 2a 20 20 20 20 63 72 | |** cr|
|00004d30| 65 61 74 65 64 20 66 69 | 6c 65 20 69 6e 20 74 68 |eated fi|le in th|
|00004d40| 65 20 63 61 74 61 6c 6f | 67 20 66 69 6c 65 20 69 |e catalo|g file i|
|00004d50| 73 20 66 6c 75 73 68 65 | 64 20 74 6f 0d 20 20 20 |s flushe|d to. |
|00004d60| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2a 2a 20 | | ** |
|00004d70| 20 20 20 64 69 73 6b 20 | 61 6e 64 20 6d 61 6b 65 | disk |and make|
|00004d80| 73 20 73 75 72 65 20 74 | 68 65 20 73 70 61 63 65 |s sure t|he space|
|00004d90| 20 70 72 65 61 6c 6c 6f | 63 61 74 65 64 20 66 6f | preallo|cated fo|
|00004da0| 72 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |r. | |
|00004db0| 20 20 2a 2a 20 20 20 20 | 66 69 6c 65 20 64 61 74 | ** |file dat|
|00004dc0| 61 20 69 73 20 61 6c 6c | 6f 63 61 74 65 64 20 6f |a is all|ocated o|
|00004dd0| 6e 20 64 69 73 6b 2e 0d | 20 20 20 20 20 20 20 20 |n disk..| |
|00004de0| 20 20 20 20 20 20 20 20 | 2a 2f 0d 20 20 20 20 20 | |*/. |
|00004df0| 20 20 20 20 20 20 20 20 | 20 20 20 72 65 73 75 6c | | resul|
|00004e00| 74 20 3d 20 4d 6f 72 65 | 53 70 61 63 65 28 72 65 |t = More|Space(re|
|00004e10| 66 4e 75 6d 2c 20 72 65 | 70 6c 79 2e 73 66 46 69 |fNum, re|ply.sfFi|
|00004e20| 6c 65 2e 76 52 65 66 4e | 75 6d 29 3b 0d 20 20 20 |le.vRefN|um);. |
|00004e30| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 0d 20 20 | | . |
|00004e40| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2a | | /*|
|00004e50| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00004e60| 20 2a 2a 20 20 20 20 57 | 72 69 74 65 20 66 69 6c | ** W|rite fil|
|00004e70| 65 20 69 6e 20 70 69 65 | 63 65 73 20 75 6e 74 69 |e in pie|ces unti|
|00004e80| 6c 20 77 65 27 72 65 20 | 64 6f 6e 65 20 77 72 69 |l we're |done wri|
|00004e90| 74 69 6e 67 2c 20 6f 72 | 20 75 6e 74 69 6c 0d 20 |ting, or| until. |
|00004ea0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2a | | *|
|00004eb0| 2a 20 20 20 20 61 6e 20 | 65 72 72 6f 72 20 6f 63 |* an |error oc|
|00004ec0| 63 75 72 73 2e 0d 20 20 | 20 20 20 20 20 20 20 20 |curs.. | |
|00004ed0| 20 20 20 20 20 20 2a 2f | 0d 20 20 20 20 20 20 20 | */|. |
|00004ee0| 20 20 20 20 20 20 20 20 | 20 64 6f 6e 65 57 72 69 | | doneWri|
|00004ef0| 74 69 6e 67 20 3d 20 66 | 61 6c 73 65 3b 0d 20 20 |ting = f|alse;. |
|00004f00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 77 68 | | wh|
|00004f10| 69 6c 65 20 28 20 28 72 | 65 73 75 6c 74 20 3d 3d |ile ( (r|esult ==|
|00004f20| 20 6e 6f 45 72 72 29 20 | 26 26 20 21 64 6f 6e 65 | noErr) |&& !done|
|00004f30| 57 72 69 74 69 6e 67 20 | 29 0d 20 20 20 20 20 20 |Writing |). |
|00004f40| 20 20 20 20 20 20 20 20 | 20 20 7b 0d 20 20 20 20 | | {. |
|00004f50| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004f60| 72 65 73 75 6c 74 20 3d | 20 28 2a 77 72 69 74 65 |result =| (*write|
|00004f70| 50 72 6f 63 29 20 28 72 | 65 66 4e 75 6d 2c 20 26 |Proc) (r|efNum, &|
|00004f80| 64 6f 6e 65 57 72 69 74 | 69 6e 67 2c 20 79 6f 75 |doneWrit|ing, you|
|00004f90| 72 44 61 74 61 50 74 72 | 29 3b 0d 20 20 20 20 20 |rDataPtr|);. |
|00004fa0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 69 | | i|
|00004fb0| 66 20 28 20 72 65 73 75 | 6c 74 20 3d 3d 20 6e 6f |f ( resu|lt == no|
|00004fc0| 45 72 72 20 29 0d 20 20 | 20 20 20 20 20 20 20 20 |Err ). | |
|00004fd0| 20 20 20 20 20 20 20 20 | 20 20 7b 0d 20 20 20 20 | | {. |
|00004fe0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004ff0| 20 20 20 20 69 66 20 28 | 20 21 64 6f 6e 65 57 72 | if (| !doneWr|
|00005000| 69 74 69 6e 67 20 29 0d | 20 20 20 20 20 20 20 20 |iting ).| |
|00005010| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005020| 7b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |{. | |
|00005030| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2a | | /*|
|00005040| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00005050| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2a 2a 20 | | ** |
|00005060| 20 20 20 57 65 27 72 65 | 20 6e 6f 74 20 64 6f 6e | We're| not don|
|00005070| 65 20 77 72 69 74 69 6e | 67 2e 20 43 68 65 63 6b |e writin|g. Check|
|00005080| 20 61 6c 6c 6f 63 61 74 | 65 64 20 73 70 61 63 65 | allocat|ed space|
|00005090| 2c 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |,. | |
|000050a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2a 2a | | **|
|000050b0| 20 20 20 20 74 68 65 6e | 20 61 6c 6c 6f 63 61 74 | then| allocat|
|000050c0| 65 20 6d 6f 72 65 20 73 | 70 61 63 65 20 61 6e 64 |e more s|pace and|
|000050d0| 20 66 6c 75 73 68 20 74 | 68 65 20 76 6f 6c 75 6d | flush t|he volum|
|000050e0| 65 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |e. | |
|000050f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2a 2a | | **|
|00005100| 20 20 20 20 28 74 6f 20 | 6d 61 6b 65 20 73 75 72 | (to |make sur|
|00005110| 65 20 74 68 65 20 73 70 | 61 63 65 20 69 73 20 72 |e the sp|ace is r|
|00005120| 65 61 6c 6c 79 20 61 6c | 6c 6f 63 61 74 65 64 0d |eally al|located.|
|00005130| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005140| 20 20 20 20 20 20 20 20 | 20 20 20 20 2a 2a 20 20 | | ** |
|00005150| 20 20 6f 6e 20 64 69 73 | 6b 29 20 69 66 20 6e 65 | on dis|k) if ne|
|00005160| 65 64 65 64 2e 0d 20 20 | 20 20 20 20 20 20 20 20 |eded.. | |
|00005170| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005180| 20 20 2a 2f 0d 20 20 20 | 20 20 20 20 20 20 20 20 | */. | |
|00005190| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000051a0| 20 72 65 73 75 6c 74 20 | 3d 20 4d 6f 72 65 53 70 | result |= MoreSp|
|000051b0| 61 63 65 28 72 65 66 4e | 75 6d 2c 20 72 65 70 6c |ace(refN|um, repl|
|000051c0| 79 2e 73 66 46 69 6c 65 | 2e 76 52 65 66 4e 75 6d |y.sfFile|.vRefNum|
|000051d0| 29 3b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |);. | |
|000051e0| 20 20 20 20 20 20 20 20 | 20 20 20 7d 0d 20 20 20 | | }. |
|000051f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005200| 20 20 20 20 20 65 6c 73 | 65 0d 20 20 20 20 20 20 | els|e. |
|00005210| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005220| 20 20 7b 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 | {. | |
|00005230| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005240| 2f 2a 20 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |/* . | |
|00005250| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005260| 2a 2a 20 20 20 20 57 65 | 27 72 65 20 64 6f 6e 65 |** We|'re done|
|00005270| 20 77 72 69 74 69 6e 67 | 2e 20 54 72 75 6e 63 61 | writing|. Trunca|
|00005280| 74 65 20 66 69 6c 65 20 | 74 6f 20 63 75 72 72 65 |te file |to curre|
|00005290| 6e 74 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |nt. | |
|000052a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2a | | *|
|000052b0| 2a 20 20 20 20 66 69 6c | 65 20 70 6f 73 69 74 69 |* fil|e positi|
|000052c0| 6f 6e 2e 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |on.. | |
|000052d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000052e0| 2a 2f 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |*/. | |
|000052f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 72 | | r|
|00005300| 65 73 75 6c 74 20 3d 20 | 47 65 74 46 50 6f 73 28 |esult = |GetFPos(|
|00005310| 72 65 66 4e 75 6d 2c 20 | 26 66 69 6c 65 50 6f 73 |refNum, |&filePos|
|00005320| 29 3b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |);. | |
|00005330| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 69 | | i|
|00005340| 66 20 28 20 72 65 73 75 | 6c 74 20 3d 3d 20 6e 6f |f ( resu|lt == no|
|00005350| 45 72 72 20 29 0d 20 20 | 20 20 20 20 20 20 20 20 |Err ). | |
|00005360| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005370| 20 20 7b 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 | {. | |
|00005380| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005390| 20 20 20 20 72 65 73 75 | 6c 74 20 3d 20 53 65 74 | resu|lt = Set|
|000053a0| 45 4f 46 28 72 65 66 4e | 75 6d 2c 20 66 69 6c 65 |EOF(refN|um, file|
|000053b0| 50 6f 73 29 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |Pos);. | |
|000053c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000053d0| 20 20 7d 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 | }. | |
|000053e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 7d 0d 20 20 | | }. |
|000053f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005400| 20 20 7d 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 | }. | |
|00005410| 20 20 20 20 7d 0d 20 20 | 20 20 20 20 20 20 20 20 | }. | |
|00005420| 20 20 20 20 20 20 0d 20 | 20 20 20 20 20 20 20 20 | . | |
|00005430| 20 20 20 20 20 20 20 2f | 2a 0d 20 20 20 20 20 20 | /|*. |
|00005440| 20 20 20 20 20 20 20 20 | 20 20 2a 2a 20 20 20 20 | | ** |
|00005450| 43 6c 6f 73 65 20 74 68 | 65 20 66 69 6c 65 20 28 |Close th|e file (|
|00005460| 77 68 69 63 68 20 66 6c | 75 73 68 65 73 20 74 68 |which fl|ushes th|
|00005470| 65 20 66 69 6c 65 29 20 | 61 6e 64 20 74 68 65 6e |e file) |and then|
|00005480| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00005490| 20 2a 2a 20 20 20 20 66 | 6c 75 73 68 20 74 68 65 | ** f|lush the|
|000054a0| 20 76 6f 6c 75 6d 65 20 | 74 6f 20 65 6e 73 75 72 | volume |to ensur|
|000054b0| 65 20 74 68 65 20 66 69 | 6c 65 27 73 20 66 69 6e |e the fi|le's fin|
|000054c0| 61 6c 20 45 4f 46 0d 20 | 20 20 20 20 20 20 20 20 |al EOF. | |
|000054d0| 20 20 20 20 20 20 20 2a | 2a 20 20 20 20 69 73 20 | *|* is |
|000054e0| 77 72 69 74 74 65 6e 20 | 74 6f 20 74 68 65 20 76 |written |to the v|
|000054f0| 6f 6c 75 6d 65 20 63 61 | 74 61 6c 6f 67 2e 0d 20 |olume ca|talog.. |
|00005500| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2a | | *|
|00005510| 2f 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |/. | |
|00005520| 20 20 28 76 6f 69 64 29 | 20 46 53 43 6c 6f 73 65 | (void)| FSClose|
|00005530| 28 72 65 66 4e 75 6d 29 | 3b 0d 20 20 20 20 20 20 |(refNum)|;. |
|00005540| 20 20 20 20 20 20 20 20 | 20 20 28 76 6f 69 64 29 | | (void)|
|00005550| 20 46 6c 75 73 68 56 6f | 6c 28 4e 55 4c 4c 2c 20 | FlushVo|l(NULL, |
|00005560| 72 65 70 6c 79 2e 73 66 | 46 69 6c 65 2e 76 52 65 |reply.sf|File.vRe|
|00005570| 66 4e 75 6d 29 3b 0d 20 | 20 20 20 20 20 20 20 20 |fNum);. | |
|00005580| 20 20 20 7d 0d 20 20 20 | 20 20 20 20 20 7d 0d 20 | }. | }. |
|00005590| 20 20 20 7d 0d 20 20 20 | 20 72 65 74 75 72 6e 20 | }. | return |
|000055a0| 28 20 72 65 73 75 6c 74 | 20 29 3b 0d 7d 0d 41 73 |( result| );.}.As|
|000055b0| 20 73 68 6f 77 6e 20 69 | 6e 20 74 68 65 20 65 78 | shown i|n the ex|
|000055c0| 61 6d 70 6c 65 20 61 62 | 6f 76 65 3a 0d a5 09 49 |ample ab|ove:...I|
|000055d0| 66 20 63 68 61 6e 67 65 | 73 20 61 72 65 20 6d 61 |f change|s are ma|
|000055e0| 64 65 20 74 6f 20 73 70 | 61 63 65 20 74 68 61 74 |de to sp|ace that|
|000055f0| 20 61 6c 72 65 61 64 79 | 20 65 78 69 73 74 73 20 | already| exists |
|00005600| 69 6e 20 61 20 66 69 6c | 65 20 28 69 2e 65 2e 2c |in a fil|e (i.e.,|
|00005610| 20 79 6f 75 20 61 72 65 | 20 6f 76 65 72 77 72 69 | you are| overwri|
|00005620| 74 69 6e 67 20 65 78 69 | 73 74 69 6e 67 20 64 61 |ting exi|sting da|
|00005630| 74 61 20 62 65 66 6f 72 | 65 20 74 68 65 20 66 69 |ta befor|e the fi|
|00005640| 6c 65 d5 73 20 45 4f 46 | 29 2c 20 50 42 46 6c 75 |le.s EOF|), PBFlu|
|00005650| 73 68 46 69 6c 65 20 77 | 69 6c 6c 20 65 6e 73 75 |shFile w|ill ensu|
|00005660| 72 65 20 65 76 65 72 79 | 74 68 69 6e 67 20 77 72 |re every|thing wr|
|00005670| 69 74 74 65 6e 20 74 6f | 20 74 68 65 20 66 69 6c |itten to| the fil|
|00005680| 65 20 69 73 20 77 72 69 | 74 74 65 6e 20 74 6f 20 |e is wri|tten to |
|00005690| 64 69 73 6b 2e 20 49 6e | 20 74 68 69 73 20 63 61 |disk. In| this ca|
|000056a0| 73 65 2c 20 74 68 65 20 | 6f 6e 6c 79 20 70 6f 73 |se, the |only pos|
|000056b0| 73 69 62 6c 65 20 64 61 | 74 61 20 6c 6f 73 73 20 |sible da|ta loss |
|000056c0| 69 6e 20 61 20 73 79 73 | 74 65 6d 20 63 72 61 73 |in a sys|tem cras|
|000056d0| 68 20 77 69 6c 6c 20 62 | 65 20 74 68 65 20 66 69 |h will b|e the fi|
|000056e0| 6c 65 d5 73 20 6d 6f 64 | 69 66 69 63 61 74 69 6f |le.s mod|ificatio|
|000056f0| 6e 20 64 61 74 65 2e 0d | a5 09 49 66 20 63 68 61 |n date..|..If cha|
|00005700| 6e 67 65 73 20 61 72 65 | 20 6d 61 64 65 20 74 6f |nges are| made to|
|00005710| 20 61 20 66 69 6c 65 20 | 74 68 61 74 20 61 66 66 | a file |that aff|
|00005720| 65 63 74 20 74 68 65 20 | 66 69 6c 65 d5 73 20 45 |ect the |file.s E|
|00005730| 4f 46 2c 20 74 68 65 20 | 66 69 6c 65 d5 73 20 6e |OF, the |file.s n|
|00005740| 61 6d 65 2c 20 74 68 65 | 20 66 69 6c 65 d5 73 20 |ame, the| file.s |
|00005750| 46 69 6e 64 65 72 20 69 | 6e 66 6f 72 6d 61 74 69 |Finder i|nformati|
|00005760| 6f 6e 2c 20 6f 72 20 74 | 68 65 20 66 69 6c 65 d5 |on, or t|he file.|
|00005770| 73 20 6c 6f 63 61 74 69 | 6f 6e 20 6f 6e 20 74 68 |s locati|on on th|
|00005780| 65 20 76 6f 6c 75 6d 65 | 2c 20 74 68 65 6e 20 50 |e volume|, then P|
|00005790| 42 46 6c 75 73 68 56 6f | 6c 20 6d 75 73 74 20 62 |BFlushVo|l must b|
|000057a0| 65 20 75 73 65 64 20 74 | 6f 20 65 6e 73 75 72 65 |e used t|o ensure|
|000057b0| 20 74 68 65 20 63 68 61 | 6e 67 65 73 20 74 6f 20 | the cha|nges to |
|000057c0| 74 68 65 20 66 69 6c 65 | 20 61 72 65 20 77 72 69 |the file| are wri|
|000057d0| 74 74 65 6e 20 74 6f 20 | 64 69 73 6b 2e 0d 43 6f |tten to |disk..Co|
|000057e0| 6e 63 6c 75 73 69 6f 6e | 0d 49 6d 70 6c 65 6d 65 |nclusion|.Impleme|
|000057f0| 6e 74 69 6e 67 20 74 68 | 65 20 73 75 67 67 65 73 |nting th|e sugges|
|00005800| 74 69 6f 6e 73 20 69 6e | 20 74 68 69 73 20 6e 6f |tions in| this no|
|00005810| 74 65 20 d1 20 69 6e 63 | 72 65 61 73 69 6e 67 20 |te . inc|reasing |
|00005820| 74 68 65 20 73 69 7a 65 | 20 6f 66 20 79 6f 75 72 |the size| of your|
|00005830| 20 49 2f 4f 20 72 65 71 | 75 65 73 74 73 2c 20 62 | I/O req|uests, b|
|00005840| 6c 6f 63 6b 20 61 6c 69 | 67 6e 69 6e 67 20 79 6f |lock ali|gning yo|
|00005850| 75 72 20 49 2f 4f 20 72 | 65 71 75 65 73 74 73 2c |ur I/O r|equests,|
|00005860| 20 61 6e 64 20 75 73 69 | 6e 67 20 74 68 65 20 46 | and usi|ng the F|
|00005870| 69 6c 65 20 4d 61 6e 61 | 67 65 72 d5 73 20 63 61 |ile Mana|ger.s ca|
|00005880| 63 68 65 20 74 6f 20 79 | 6f 75 72 20 61 64 76 61 |che to y|our adva|
|00005890| 6e 74 61 67 65 20 d1 20 | 77 69 6c 6c 20 69 6e 63 |ntage . |will inc|
|000058a0| 72 65 61 73 65 20 74 68 | 65 20 70 65 72 66 6f 72 |rease th|e perfor|
|000058b0| 6d 61 6e 63 65 20 6f 66 | 20 79 6f 75 72 20 66 69 |mance of| your fi|
|000058c0| 6c 65 20 49 2f 4f 20 61 | 6e 64 20 70 6f 73 73 69 |le I/O a|nd possi|
|000058d0| 62 6c 79 20 74 68 65 20 | 66 69 6c 65 20 73 79 73 |bly the |file sys|
|000058e0| 74 65 6d 20 70 65 72 66 | 6f 72 6d 61 6e 63 65 20 |tem perf|ormance |
|000058f0| 6f 66 20 74 68 65 20 77 | 68 6f 6c 65 20 4d 61 63 |of the w|hole Mac|
|00005900| 69 6e 74 6f 73 68 20 73 | 79 73 74 65 6d 2e 20 49 |intosh s|ystem. I|
|00005910| 6e 20 61 64 64 69 74 69 | 6f 6e 2c 20 79 6f 75 20 |n additi|on, you |
|00005920| 6d 61 79 20 77 61 6e 74 | 20 74 6f 20 65 78 61 6d |may want| to exam|
|00005930| 69 6e 65 20 68 6f 77 20 | 61 6e 64 20 77 68 79 20 |ine how |and why |
|00005940| 79 6f 75 20 66 6c 75 73 | 68 20 66 69 6c 65 73 20 |you flus|h files |
|00005950| 6f 72 20 76 6f 6c 75 6d | 65 73 2c 20 61 6e 64 20 |or volum|es, and |
|00005960| 70 72 65 61 6c 6c 6f 63 | 61 74 65 20 73 70 61 63 |prealloc|ate spac|
|00005970| 65 20 66 6f 72 20 6e 65 | 77 20 66 69 6c 65 73 2e |e for ne|w files.|
|00005980| 0d 54 68 65 72 65 20 61 | 72 65 20 6f 74 68 65 72 |.There a|re other|
|00005990| 20 75 73 65 66 75 6c 20 | 74 65 63 68 6e 69 71 75 | useful |techniqu|
|000059a0| 65 73 20 6e 6f 74 20 64 | 69 73 63 75 73 73 65 64 |es not d|iscussed|
|000059b0| 20 69 6e 20 74 68 69 73 | 20 4e 6f 74 65 20 74 68 | in this| Note th|
|000059c0| 61 74 20 79 6f 75 20 6d | 61 79 20 77 61 6e 74 20 |at you m|ay want |
|000059d0| 74 6f 20 63 6f 6e 73 69 | 64 65 72 3a 0d a5 09 59 |to consi|der:...Y|
|000059e0| 6f 75 20 63 6f 75 6c 64 | 20 69 6d 70 6c 65 6d 65 |ou could| impleme|
|000059f0| 6e 74 20 79 6f 75 72 20 | 6f 77 6e 20 62 75 66 66 |nt your |own buff|
|00005a00| 65 72 69 6e 67 20 73 63 | 68 65 6d 65 20 61 62 6f |ering sc|heme abo|
|00005a10| 76 65 20 74 68 65 20 46 | 69 6c 65 20 4d 61 6e 61 |ve the F|ile Mana|
|00005a20| 67 65 72 2e 20 46 6f 72 | 20 65 78 61 6d 70 6c 65 |ger. For| example|
|00005a30| 2c 20 74 68 65 20 66 69 | 6c 65 20 73 74 72 65 61 |, the fi|le strea|
|00005a40| 6d 20 6c 69 62 72 61 72 | 69 65 73 20 73 75 70 70 |m librar|ies supp|
|00005a50| 6c 69 65 64 20 62 79 20 | 6d 61 6e 79 20 6f 62 6a |lied by |many obj|
|00005a60| 65 63 74 2d 6f 72 69 65 | 6e 74 65 64 20 64 65 76 |ect-orie|nted dev|
|00005a70| 65 6c 6f 70 6d 65 6e 74 | 20 65 6e 76 69 72 6f 6e |elopment| environ|
|00005a80| 6d 65 6e 74 73 20 61 6c | 6c 6f 77 20 79 6f 75 20 |ments al|low you |
|00005a90| 74 6f 20 70 65 72 66 6f | 72 6d 20 66 69 6c 65 20 |to perfo|rm file |
|00005aa0| 49 2f 4f 20 75 73 69 6e | 67 20 61 20 70 6f 69 6e |I/O usin|g a poin|
|00005ab0| 74 65 72 20 6f 72 20 68 | 61 6e 64 6c 65 20 74 6f |ter or h|andle to|
|00005ac0| 20 61 20 52 41 4d 20 62 | 75 66 66 65 72 2e 0d a5 | a RAM b|uffer...|
|00005ad0| 09 59 6f 75 20 63 61 6e | 20 75 73 65 20 61 73 79 |.You can| use asy|
|00005ae0| 6e 63 68 72 6f 6e 6f 75 | 73 20 72 65 61 64 20 6f |nchronou|s read o|
|00005af0| 72 20 77 72 69 74 65 73 | 20 74 68 61 74 20 6f 76 |r writes| that ov|
|00005b00| 65 72 6c 61 70 20 77 69 | 74 68 20 6f 74 68 65 72 |erlap wi|th other|
|00005b10| 20 6e 6f 6e 2d 46 69 6c | 65 20 4d 61 6e 61 67 65 | non-Fil|e Manage|
|00005b20| 72 20 6f 70 65 72 61 74 | 69 6f 6e 73 20 61 6c 6c |r operat|ions all|
|00005b30| 6f 77 20 70 72 6f 67 72 | 61 6d 73 20 74 6f 20 64 |ow progr|ams to d|
|00005b40| 6f 20 73 6f 6d 65 74 68 | 69 6e 67 20 62 65 73 69 |o someth|ing besi|
|00005b50| 64 65 73 20 73 68 6f 77 | 20 74 68 65 20 77 61 74 |des show| the wat|
|00005b60| 63 68 20 63 75 72 73 6f | 72 20 77 68 69 6c 65 20 |ch curso|r while |
|00005b70| 66 69 6c 65 20 49 2f 4f | 20 69 73 20 70 65 72 66 |file I/O| is perf|
|00005b80| 6f 72 6d 65 64 2e 20 46 | 6f 72 20 65 78 61 6d 70 |ormed. F|or examp|
|00005b90| 6c 65 2c 20 74 68 65 20 | 61 72 74 69 63 6c 65 2c |le, the |article,|
|00005ba0| 20 d2 43 6f 6e 63 75 72 | 72 65 6e 74 20 50 72 6f | .Concur|rent Pro|
|00005bb0| 67 72 61 6d 6d 69 6e 67 | 20 77 69 74 68 20 74 68 |gramming| with th|
|00005bc0| 65 20 54 68 72 65 61 64 | 20 4d 61 6e 61 67 65 72 |e Thread| Manager|
|00005bd0| d3 20 69 6e 20 64 65 76 | 65 6c 6f 70 20 69 73 73 |. in dev|elop iss|
|00005be0| 75 65 20 23 31 37 20 73 | 68 6f 77 73 20 68 6f 77 |ue #17 s|hows how|
|00005bf0| 20 74 6f 20 70 65 72 66 | 6f 72 6d 20 61 73 79 6e | to perf|orm asyn|
|00005c00| 63 68 72 6f 6e 6f 75 73 | 20 49 2f 4f 20 69 6e 20 |chronous| I/O in |
|00005c10| 63 6f 6f 70 65 72 61 74 | 69 76 65 20 74 68 72 65 |cooperat|ive thre|
|00005c20| 61 64 73 2e 0d 46 75 72 | 74 68 65 72 20 52 65 66 |ads..Fur|ther Ref|
|00005c30| 65 72 65 6e 63 65 3a 0d | a5 09 49 6e 73 69 64 65 |erence:.|..Inside|
|00005c40| 20 4d 61 63 69 6e 74 6f | 73 68 3a 20 46 69 6c 65 | Macinto|sh: File|
|00005c50| 73 0d a5 09 54 65 63 68 | 6e 69 63 61 6c 20 4e 6f |s...Tech|nical No|
|00005c60| 74 65 2c 20 49 6e 73 69 | 64 65 20 4d 61 63 69 6e |te, Insi|de Macin|
|00005c70| 74 6f 73 68 d1 46 69 6c | 65 73 20 45 72 72 61 74 |tosh.Fil|es Errat|
|00005c80| 61 0d a5 09 d2 41 73 79 | 6e 63 68 72 6f 6e 6f 75 |a....Asy|nchronou|
|00005c90| 73 20 52 6f 75 74 69 6e | 65 73 20 6f 6e 20 74 68 |s Routin|es on th|
|00005ca0| 65 20 4d 61 63 69 6e 74 | 6f 73 68 d3 20 62 79 20 |e Macint|osh. by |
|00005cb0| 4a 69 6d 20 4c 75 74 68 | 65 72 2c 20 64 65 76 65 |Jim Luth|er, deve|
|00005cc0| 6c 6f 70 20 49 73 73 75 | 65 20 31 33 0d a5 09 d2 |lop Issu|e 13....|
|00005cd0| 43 6f 6e 63 75 72 72 65 | 6e 74 20 50 72 6f 67 72 |Concurre|nt Progr|
|00005ce0| 61 6d 6d 69 6e 67 20 77 | 69 74 68 20 74 68 65 20 |amming w|ith the |
|00005cf0| 54 68 72 65 61 64 20 4d | 61 6e 61 67 65 72 d3 20 |Thread M|anager. |
|00005d00| 62 79 20 45 72 69 63 20 | 41 6e 64 65 72 73 6f 6e |by Eric |Anderson|
|00005d10| 20 61 6e 64 20 42 72 61 | 64 20 50 6f 73 74 2c 20 | and Bra|d Post, |
|00005d20| 64 65 76 65 6c 6f 70 20 | 49 73 73 75 65 20 31 37 |develop |Issue 17|
|00005d30| 0d 16 36 00 00 00 00 03 | 09 02 14 00 11 02 ff 0c |..6.....|........|
|00005d40| 00 ff ff ff ff 00 00 00 | 00 00 00 00 00 02 14 00 |........|........|
|00005d50| 00 03 09 00 00 00 00 00 | 00 00 a0 00 82 00 1e 00 |........|........|
|00005d60| 0c 00 1c 00 1e 00 01 00 | 0a 00 24 00 5a 00 76 02 |........|..$.Z.v.|
|00005d70| 23 00 07 00 00 00 00 00 | 08 00 0a 00 09 30 49 88 |#.......|.....0I.|
|00005d80| 3a b5 9c f0 39 00 22 00 | 70 02 1a 00 00 00 09 ff |:...9.".|p.......|
|00005d90| ff ff ff ff ff ff ff 00 | 23 00 00 00 a0 00 c4 00 |........|#.......|
|00005da0| a1 00 64 00 0a 4f 4e 4c | 4e 00 66 00 00 01 fe 00 |..d..ONL|N.f.....|
|00005db0| a0 00 8c 00 a1 00 64 00 | 31 64 72 77 32 00 02 01 |......d.|1drw2...|
|00005dc0| c9 00 2d 01 e1 01 5f 00 | 00 80 00 00 00 00 00 00 |..-..._.|........|
|00005dd0| 00 00 00 00 00 00 00 00 | 00 00 00 ff ff ff ff ff |........|........|
|00005de0| ff 00 01 00 00 01 8f 00 | 00 00 00 00 a1 00 96 00 |........|........|
|00005df0| 0c 01 00 00 00 02 78 00 | 00 00 00 00 00 00 a1 00 |......x.|........|
|00005e00| 64 00 10 64 72 77 32 00 | 3a 00 05 00 00 00 00 00 |d..drw2.|:.......|
|00005e10| 01 00 00 00 a1 00 64 00 | 0e 64 72 77 32 00 3a 00 |......d.|.drw2.:.|
|00005e20| 02 00 24 00 00 00 00 00 | a1 00 64 00 34 64 72 77 |..$.....|..d.4drw|
|00005e30| 32 00 3a 00 01 00 03 01 | 00 00 18 00 00 00 00 00 |2.:.....|........|
|00005e40| 00 00 00 00 00 00 01 00 | 01 00 01 00 01 00 00 00 |........|........|
|00005e50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005e60| 00 00 a1 00 9a 00 08 ff | fa 00 00 00 97 40 00 00 |........|.....@..|
|00005e70| a0 00 98 00 2c 00 08 00 | 14 05 54 69 6d 65 73 00 |....,...|..Times.|
|00005e80| 03 00 14 00 04 01 00 00 | 0d 00 18 00 2e 00 04 00 |........|........|
|00005e90| 00 01 00 00 10 00 52 01 | c9 00 52 01 c9 00 2b 5d |......R.|..R...+]|
|00005ea0| 37 13 4e 65 77 20 54 65 | 63 68 6e 69 63 61 6c 20 |7.New Te|chnical |
|00005eb0| 4e 6f 74 65 73 00 a0 00 | 99 00 a1 00 64 00 08 64 |Notes...|....d..d|
|00005ec0| 72 77 32 00 3a 00 04 00 | a1 14 e3 00 02 00 01 00 |rw2.:...|........|
|00005ed0| a0 00 97 00 a1 00 64 00 | 31 64 72 77 32 00 02 02 |......d.|1drw2...|
|00005ee0| 06 01 65 02 19 01 f4 00 | 00 80 00 00 00 00 00 00 |..e.....|........|
|00005ef0| 00 00 00 00 00 00 00 00 | 00 00 00 ff ff ff ff ff |........|........|
|00005f00| ff 00 01 00 00 01 50 00 | 00 00 00 00 a1 00 96 00 |......P.|........|
|00005f10| 0c 01 00 00 00 02 78 00 | 00 00 00 00 00 00 a1 00 |......x.|........|
|00005f20| 64 00 10 64 72 77 32 00 | 3a 00 05 00 00 00 00 00 |d..drw2.|:.......|
|00005f30| 01 00 00 00 a1 00 64 00 | 0e 64 72 77 32 00 3a 00 |......d.|.drw2.:.|
|00005f40| 02 00 24 00 00 00 00 00 | a1 00 64 00 34 64 72 77 |..$.....|..d.4drw|
|00005f50| 32 00 3a 00 01 00 03 00 | 00 00 12 00 00 00 00 00 |2.:.....|........|
|00005f60| 00 00 00 00 00 00 01 00 | 01 00 01 00 01 00 00 00 |........|........|
|00005f70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005f80| 00 00 a1 00 9a 00 08 ff | fb 80 00 00 45 c0 00 00 |........|....E...|
|00005f90| a0 00 98 00 04 00 00 00 | 0d 00 12 00 28 00 70 01 |........|....(.p.|
|00005fa0| 95 11 44 65 76 65 6c 6f | 70 65 72 20 53 75 70 70 |..Develo|per Supp|
|00005fb0| 6f 72 74 00 a0 00 99 00 | a1 00 64 00 08 64 72 77 |ort.....|..d..drw|
|00005fc0| 32 00 3a 00 04 00 a1 14 | e3 00 02 00 01 00 a0 00 |2.:.....|........|
|00005fd0| 97 00 a1 00 64 00 60 64 | 72 77 32 00 03 02 00 00 |....d.`d|rw2.....|
|00005fe0| 2d 02 00 01 ef 00 00 00 | 00 00 00 00 00 02 02 00 |-.......|........|
|00005ff0| 00 00 00 00 00 00 00 00 | 00 ff ff ff ff ff ff 00 |........|........|
|00006000| 01 00 01 08 4b 00 00 00 | 00 02 00 01 ef 02 00 00 |....K...|........|
|00006010| 2d 00 00 00 00 00 00 00 | 00 00 01 00 14 00 0c 00 |-.......|........|
|00006020| 03 00 02 00 00 00 5a 00 | 01 00 00 00 02 00 00 00 |......Z.|........|
|00006030| 03 00 0c 00 00 00 00 00 | 07 00 02 00 02 00 08 00 |........|........|
|00006040| 08 00 20 00 5b 02 1c 00 | 5b 00 5a 00 a1 00 64 00 |.. .[...|[.Z...d.|
|00006050| 31 64 72 77 32 00 02 01 | ca 01 c0 01 fa 01 e9 00 |1drw2...|........|
|00006060| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006070| 00 00 00 ff ff ff ff ff | ff 00 01 00 00 01 4b 00 |........|......K.|
|00006080| 00 00 00 00 a1 00 96 00 | 0c 01 00 00 00 02 78 00 |........|......x.|
|00006090| 00 00 00 00 00 00 a1 00 | 64 00 10 64 72 77 32 00 |........|d..drw2.|
|000060a0| 3a 00 05 00 00 00 00 00 | 01 00 00 00 a1 00 64 00 |:.......|......d.|
|000060b0| 0e 64 72 77 32 00 3a 00 | 02 00 24 00 00 00 00 00 |.drw2.:.|..$.....|
|000060c0| a1 00 64 00 34 64 72 77 | 32 00 3a 00 01 00 03 00 |..d.4drw|2.:.....|
|000060d0| 00 00 30 00 00 00 00 00 | 00 00 00 00 00 00 01 00 |..0.....|........|
|000060e0| 01 00 01 00 01 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000060f0| 00 00 00 00 00 00 00 00 | 00 00 a1 00 9a 00 08 ff |........|........|
|00006100| f4 00 00 00 13 80 00 00 | a0 00 98 00 0d 00 30 00 |........|......0.|
|00006110| 28 00 4a 01 ef 01 f0 00 | a0 00 99 00 a1 00 64 00 |(.J.....|......d.|
|00006120| 08 64 72 77 32 00 3a 00 | 04 00 a1 14 e3 00 02 00 |.drw2.:.|........|
|00006130| 01 00 a0 00 97 00 a1 00 | 64 00 31 64 72 77 32 00 |........|d.1drw2.|
|00006140| 02 01 ef 01 e6 01 fa 01 | f0 00 00 00 00 00 00 00 |........|........|
|00006150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 ff ff ff |........|........|
|00006160| ff ff ff 00 01 00 00 01 | 00 00 00 00 00 00 a1 00 |........|........|
|00006170| 96 00 0c 01 00 00 00 02 | 78 00 00 00 00 00 00 00 |........|x.......|
|00006180| a1 00 64 00 10 64 72 77 | 32 00 3a 00 05 00 00 00 |..d..drw|2.:.....|
|00006190| 00 00 01 00 00 00 a1 00 | 64 00 0e 64 72 77 32 00 |........|d..drw2.|
|000061a0| 3a 00 02 00 24 00 00 00 | 00 00 a1 00 64 00 34 64 |:...$...|....d.4d|
|000061b0| 72 77 32 00 3a 00 01 00 | 03 00 00 00 09 00 00 00 |rw2.:...|........|
|000061c0| 00 00 00 00 00 00 00 00 | 01 00 01 00 01 00 01 00 |........|........|
|000061d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000061e0| 00 00 00 00 a1 00 9a 00 | 08 ff fd 80 00 00 04 00 |........|........|
|000061f0| 00 00 a0 00 98 00 0d 00 | 09 00 2b 26 09 01 a8 00 |........|..+&....|
|00006200| a0 00 99 00 a1 00 64 00 | 08 64 72 77 32 00 3a 00 |......d.|.drw2.:.|
|00006210| 04 00 a1 14 e3 00 02 00 | 01 00 a0 00 97 00 a1 00 |........|........|
|00006220| 64 00 31 64 72 77 32 00 | 02 01 e5 00 2d 01 f8 00 |d.1drw2.|....-...|
|00006230| 79 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |y.......|........|
|00006240| 00 00 00 00 00 ff ff ff | ff ff ff 00 01 00 01 01 |........|........|
|00006250| 00 00 00 01 00 00 a1 00 | 96 00 0c 01 00 00 00 02 |........|........|
|00006260| 78 00 00 00 00 00 00 00 | a1 00 64 00 10 64 72 77 |x.......|..d..drw|
|00006270| 32 00 3a 00 05 00 00 00 | 00 00 01 00 00 00 a1 00 |2.:.....|........|
|00006280| 64 00 0e 64 72 77 32 00 | 3a 00 02 00 24 00 00 00 |d..drw2.|:...$...|
|00006290| 00 00 a1 00 64 00 34 64 | 72 77 32 00 3a 00 01 00 |....d.4d|rw2.:...|
|000062a0| 03 00 00 00 12 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000062b0| 01 00 01 00 01 00 01 00 | 00 00 00 00 00 00 00 00 |........|........|
|000062c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 a1 00 9a 00 |........|........|
|000062d0| 08 ff fb 80 00 00 25 00 | 00 00 a0 00 98 00 0d 00 |......%.|........|
|000062e0| 12 00 28 00 4f 00 5c 09 | 4d 61 63 69 6e 74 6f 73 |..(.O.\.|Macintos|
|000062f0| 68 00 a0 00 99 00 a1 00 | 64 00 08 64 72 77 32 00 |h.......|d..drw2.|
|00006300| 3a 00 04 00 a1 14 e3 00 | 02 00 01 00 a0 00 97 00 |:.......|........|
|00006310| a0 00 8d 00 a1 00 64 00 | 06 64 72 77 32 00 44 00 |......d.|.drw2.D.|
|00006320| a0 00 83 00 01 00 0a 00 | 00 00 00 03 45 02 4c 00 |........|....E.L.|
|00006330| 04 01 00 00 2e 00 04 00 | 00 00 00 00 10 00 01 00 |........|........|
|00006340| 01 00 01 00 01 00 a1 00 | 64 00 10 4f 4e 4c 4e 00 |........|d..ONLN.|
|00006350| 64 00 00 00 64 00 3e 00 | 77 01 c8 00 28 00 90 00 |d...d.>.|w...(...|
|00006360| 5a 2c 46 4c 20 31 36 20 | 2d 20 46 69 6c 65 20 4d |Z,FL 16 |- File M|
|00006370| 61 6e 61 67 65 72 20 50 | 65 72 66 6f 72 6d 61 6e |anager P|erforman|
|00006380| 63 65 20 61 6e 64 20 43 | 61 63 68 69 6e 67 00 00 |ce and C|aching..|
|00006390| 0d 00 0e 00 a1 00 64 00 | 10 4f 4e 4c 4e 00 64 00 |......d.|.ONLN.d.|
|000063a0| 2d 00 76 00 3e 00 85 00 | 5e 00 2a 10 05 46 69 6c |-.v.>...|^.*..Fil|
|000063b0| 65 73 00 00 04 00 00 00 | 0d 00 0c 00 a1 00 64 00 |es......|......d.|
|000063c0| 10 4f 4e 4c 4e 00 64 00 | 33 00 91 00 3e 00 9d 00 |.ONLN.d.|3...>...|
|000063d0| 76 00 2a 18 0b 52 65 76 | 69 73 65 64 20 62 79 3a |v.*..Rev|ised by:|
|000063e0| 00 00 a1 00 64 00 10 4f | 4e 4c 4e 00 64 00 3f 00 |....d..O|NLN.d.?.|
|000063f0| 91 00 86 00 9d 00 b9 00 | 29 48 0a 4a 69 6d 20 4c |........|)H.Jim L|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.